/* Ad Director. Both pages follow the reference design: Open Runde, 14/24 text, black at .8/.4 for text, .04 for surfaces. */
@font-face { font-family: "Open Runde"; font-weight: 400; font-display: swap; src: url("fonts/open-runde-latin-400-normal.d202b35167b8.woff2") format("woff2"); }
@font-face { font-family: "Open Runde"; font-weight: 500; font-display: swap; src: url("fonts/open-runde-latin-500-normal.2dc98179d6f1.woff2") format("woff2"); }
@font-face { font-family: "Open Runde"; font-weight: 600; font-display: swap; src: url("fonts/open-runde-latin-600-normal.39388f4ddcd7.woff2") format("woff2"); }
:root {
  --fg-1: rgba(0, 0, 0, .8);
  --fg-2: rgba(0, 0, 0, .4);
  --surface: rgba(0, 0, 0, .04);
  --surface-2: rgba(0, 0, 0, .06);
  --stroke: rgba(0, 0, 0, .08);
  --runde: "Open Runde", ui-sans-serif, system-ui, sans-serif;
  --bg: #fbfaf8;
  --pane: #ffffff;
  --line: #e9e6e1;
  --line-2: #f1eee9;
  --fg: #1d1c1a;
  --muted: #706b64;
  --faint: #a7a199;
  --accent: #e8542c;
  --accent-soft: #fdeee8;
  --stage: #121212;
  --stage-2: #1c1c1c;
  --stage-line: #2c2c2c;
  --stage-fg: #ecebea;
  --stage-muted: #9a9894;
  --good: #3fa66a;
  --bad: #e0473a;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body, #root { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--fg); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.loading { padding: 40px; color: var(--muted); }

.btn { border: 1px solid var(--line); background: var(--pane); border-radius: 10px; padding: 9px 18px; font-weight: 600; }
.btn.primary { background: var(--fg); border-color: var(--fg); color: #fff; }

/* home page: sizes, colours and type taken from the reference design */
body.index, body.film { --bg: #fff; display: flex; background: #fff; color: var(--fg-1); font: 14px/21px var(--runde); }
.rail { flex: none; width: 52px; height: 100vh; position: sticky; top: 0; display: flex; flex-direction: column; align-items: center; padding: 12px 0 23px; }
.rail-home { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; color: #000; }
.rail-home:hover { background: rgba(0, 0, 0, .05); }
.rail-home svg { width: 16px; height: 14px; display: block; }
.home { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; }
.hero { width: 100%; max-width: 640px; display: flex; flex-direction: column; align-items: center; padding: 100px 16px 0; }
.hero-mark { width: 58px; height: 51px; display: block; color: #000; }
.greeting { margin: 40px 0 0; font-size: 22px; line-height: 32px; font-weight: 400; color: var(--fg-1); text-align: center; }
.prompt { width: 100%; margin-top: 36px; }
.prompt-box { display: flex; flex-direction: column; border: 1px solid var(--stroke); border-radius: 42px; background: #fff; overflow: clip;
  transition: border-color .15s; }
.prompt-box:focus-within { border-color: rgba(0, 0, 0, .2); }
.prompt.sending .prompt-box { opacity: .55; pointer-events: none; }
.prompt-row { display: flex; align-items: center; gap: 8px; padding: 8px; }
.prompt-add { flex: none; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 9999px;
  background: none; color: #000; }
.prompt-add:hover { background: rgba(0, 0, 0, .05); }
.prompt-add svg { width: 16px; height: 16px; display: block; }
.prompt textarea { flex: 1; min-width: 0; margin: 4px; padding: 0; border: 0; outline: 0; resize: none; background: none; max-height: 240px;
  font: inherit; font-size: 14px; line-height: 24px; letter-spacing: -.14px; color: var(--fg-1); }
.prompt textarea::placeholder { color: var(--fg-2); opacity: 1; }
.prompt-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px 0; }
.prompt-chips:empty { display: none; }
.chip { position: relative; width: 48px; height: 48px; border-radius: 12px; overflow: hidden; background: var(--surface); }
.chip img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chip button { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%;
  background: rgba(0, 0, 0, .6); color: #fff; font-size: 12px; line-height: 18px; }

.browse { width: 100%; max-width: 1316px; margin-top: 96px; padding: 0 32px 64px; display: flex; flex-direction: column; align-items: center; gap: 32px; }
.tabs { display: flex; align-items: center; gap: 8px; }
.tab { height: 32px; padding: 0 16px; border: 0; border-radius: 9999px; background: none; font: inherit; font-size: 12px; line-height: 16px;
  color: var(--fg-2); transition: color .15s, background-color .15s; }
.tab:hover { color: var(--fg-1); }
.tab.on { background: var(--surface); color: var(--fg-1); font-weight: 500; }
.tab-pane { width: 100%; }
.tab-empty { text-align: center; color: var(--fg-2); margin: 24px 0; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, 285px); justify-content: center; gap: 32px; width: 100%; }
.card { display: flex; flex-direction: column; gap: 8px; width: 285px; height: 269px; color: inherit; text-decoration: none; }
.tile { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden;
  border-radius: 16px; background: var(--surface); transition: background-color .2s; }
.card:hover .tile { background: rgba(0, 0, 0, .06); }
.tile.one { padding: 24px; }
.poster { display: block; border-radius: 12px; background: rgba(0, 0, 0, .05); object-fit: cover; }
.one .poster { max-width: 100%; max-height: 100%; }
.fan-box { position: relative; width: 258px; height: 130px; }
.fan .poster { position: absolute; box-shadow: 0 4px 12px rgba(0, 0, 0, .25); transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
/* landscape films: as in the reference (a wide one in the middle, cropped ones tilted over each side) */
.fan.wide .p0 { left: 32px; top: 8px; width: 194px; height: 112px; }
.fan.wide .p1 { left: 12px; top: 6px; width: 68px; height: 118px; transform: rotate(-12deg); z-index: 2; }
.fan.wide .p2 { left: 167px; top: 41px; width: 83px; height: 80px; transform: rotate(12deg); z-index: 1; }
/* portrait films */
.fan.tall .p0 { left: 92px; top: 0; width: 74px; height: 130px; }
.fan.tall .p1 { left: 44px; top: 14px; width: 62px; height: 106px; transform: rotate(-12deg); z-index: 2; }
.fan.tall .p2 { left: 150px; top: 30px; width: 70px; height: 84px; transform: rotate(12deg); z-index: 1; }
.card:hover .fan .p1 { transform: rotate(-14deg) translateX(-4px); }
.card:hover .fan .p2 { transform: rotate(14deg) translateX(4px); }
.tile-mark { width: 32px; height: 28px; display: block; color: rgba(0, 0, 0, .1); }
.tile-spin { width: 22px; height: 22px; color: var(--fg-2); border-color: rgba(0, 0, 0, .08); border-top-color: currentColor; }
.card-title { font-size: 14px; line-height: 24px; letter-spacing: -.14px; color: var(--fg-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* film page: rail | chat (428) | canvas */
#root { flex: 1; min-width: 0; height: 100vh; }
.film-app { display: flex; height: 100%; }
.dim { color: var(--fg-2); }
.icon32 { flex: none; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px;
  background: none; color: #000; }
.icon32:hover { background: rgba(0, 0, 0, .05); }

/* chat column */
.chat { flex: none; width: 428px; height: 100%; overflow: hidden; border-right: 1px solid rgba(0, 0, 0, .06);
  transition: width .5s cubic-bezier(.4, 0, .1, 1), border-color .5s; }
.chat-hidden .chat { width: 0; border-right-color: transparent; }
.chat-inner { position: relative; width: 428px; height: 100%; display: flex; flex-direction: column; }
.chat-head { position: absolute; inset: 0 0 auto; z-index: 2; height: 56px; display: flex; align-items: center; gap: 4px; padding: 0 12px 0 16px;
  background: linear-gradient(#fff 70%, rgba(255, 255, 255, 0)); }
.chat-title { flex: 1; min-width: 0; text-align: left; border: 0; background: none; padding: 0; font-size: 14px; line-height: 24px;
  letter-spacing: -.14px; color: var(--fg-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.title-input { flex: 1; min-width: 0; font-size: 14px; line-height: 24px; letter-spacing: -.14px; color: var(--fg-1);
  border: 1px solid var(--stroke); border-radius: 8px; padding: 2px 8px; outline: 0; }
.title-input:focus { border-color: rgba(0, 0, 0, .2); }
.msgs { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: none; padding: 64px 24px 24px; display: flex; flex-direction: column; gap: 24px; }
.msgs::-webkit-scrollbar { display: none; }
.chat-empty { margin: auto 0; color: var(--fg-2); font-size: 14px; line-height: 24px; letter-spacing: -.14px; }
.chat-empty p { margin: 0; }
.chat-empty .chat-empty-title { color: var(--fg-1); font-size: 22px; line-height: 32px; margin-bottom: 8px; letter-spacing: 0; }
.msg { display: flex; flex-direction: column; gap: 12px; animation: fade-up .3s ease-out both; }
.msg.user { align-items: flex-end; padding-left: 24px; }
.bubble { max-width: 100%; display: flex; flex-direction: column; gap: 12px; padding: 12px 16px; border-radius: 20px; background: var(--surface); }
.txt { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 24px; letter-spacing: -.14px; color: var(--fg-1); }
.att { display: block; max-width: 100%; max-height: 200px; border-radius: 12px; object-fit: cover; align-self: flex-start; }
.dots { display: inline-flex; gap: 4px; padding: 9px 0; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--fg-2); animation: blink 1.2s infinite both; }
.dots i:nth-child(2) { animation-delay: .2s; }
.dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(6px); } }

/* version card in the chat */
.vcard { display: flex; align-items: center; gap: 16px; width: 100%; text-align: left; border: 0; border-radius: 20px; padding: 12px 16px 12px 12px;
  background: var(--surface); color: inherit; transition: background-color .2s; }
.vcard:hover, .vcard.on { background: var(--surface-2); }
.vthumb { position: relative; flex: none; width: 68px; height: 68px; border-radius: 7px; background: var(--surface); display: grid; place-items: center; overflow: hidden; }
.vthumb img { display: block; object-fit: cover; transform: rotate(-3deg); box-shadow: 0 2px 5px rgba(0, 0, 0, .25);
  transition: transform .3s cubic-bezier(.2, .8, .2, 1); animation: fadein .24s ease-out both; }
.vthumb img.wide { width: 56px; height: 32px; }
.vthumb img.tall { width: 32px; height: 56px; }
.vcard:hover .vthumb img { transform: rotate(-1deg); }
.vthumb .spin { position: absolute; }
.vbody { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.vtitle { font-size: 14px; line-height: 24px; letter-spacing: -.14px; color: var(--fg-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vmeta { font-size: 12px; line-height: 16px; color: var(--fg-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vmeta.failed { color: #d93025; }

/* composer */
.composer-wrap { flex: none; padding: 0 16px 16px; display: flex; flex-direction: column; gap: 8px; }
.starters { display: flex; flex-direction: column; gap: 8px; }
.starter { text-align: left; border: 0; border-radius: 20px; padding: 12px 16px; background: var(--surface); color: var(--fg-1);
  font-size: 14px; line-height: 24px; letter-spacing: -.14px; }
.starter:hover { background: var(--surface-2); }
.turn-status { padding: 0 16px; font-size: 12px; line-height: 16px; color: var(--fg-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.turn-status .err { color: #d93025; }
.composer { border: 1px solid var(--stroke); border-radius: 42px; background: #fff; overflow: clip; transition: border-color .15s; }
.composer:focus-within { border-color: rgba(0, 0, 0, .2); }
.composer-row { display: flex; align-items: center; gap: 8px; padding: 8px; }
.composer-add { flex: none; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 9999px; background: none; color: #000; }
.composer-add:hover { background: rgba(0, 0, 0, .05); }
.composer textarea { flex: 1; min-width: 0; margin: 4px; padding: 0; border: 0; outline: 0; resize: none; background: none; max-height: 220px;
  font: inherit; font-size: 14px; line-height: 24px; letter-spacing: -.14px; color: var(--fg-1); }
.composer.multi { border-radius: 24px; }
.composer.multi .composer-row { flex-direction: column; align-items: stretch; gap: 8px; }
.composer.multi textarea { flex: none; order: -1; margin: 4px 4px 12px; }
.composer.multi .composer-add { align-self: flex-start; }
.composer textarea::placeholder { color: var(--fg-2); opacity: 1; }
.pending { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 16px 0; }
.chip-img { position: relative; }
.chip-img img { width: 48px; height: 48px; object-fit: cover; border-radius: 12px; display: block; background: var(--surface); }
.chip-img.up img { opacity: .4; }
.chip-img button { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .6);
  color: #fff; font-size: 12px; line-height: 18px; padding: 0; }

/* canvas column */
.canvas { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; }
.canvas-head { flex: none; height: 56px; display: flex; align-items: center; gap: 8px; padding: 0 16px; min-width: 0; }
.canvas-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.cost { font-size: 12px; line-height: 16px; color: var(--fg-2); font-variant-numeric: tabular-nums; }
.conn { font-size: 12px; line-height: 16px; color: #b07a10; }

/* version menu (canvas header) */
.vm { position: relative; min-width: 0; margin-left: -8px; }
.vm-btn { display: flex; align-items: center; gap: 4px; max-width: 100%; height: 32px; padding: 0 8px; border: 0; border-radius: 8px;
  background: none; font-size: 14px; line-height: 24px; letter-spacing: -.14px; color: var(--fg-1); white-space: nowrap; }
.vm-btn:not(.idle):hover { background: var(--surface); }
.vm-btn.idle { cursor: default; }
.vm-name { overflow: hidden; text-overflow: ellipsis; }
.vm-btn .chev { flex: none; color: var(--fg-2); opacity: 0; transition: opacity .15s; }
.vm-btn:hover .chev, .vm-btn[aria-expanded="true"] .chev { opacity: 1; }
.vm-back { position: fixed; inset: 0; z-index: 9; }
/* the version menu: the shown version, its prompt, other versions, the creative spec */
.vm-menu { position: absolute; left: 0; top: 40px; z-index: 10; width: 367px; display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--stroke); border-radius: 16px; box-shadow: 0 3px 8px rgba(0, 0, 0, .12); }
.vm-top { display: flex; flex-direction: column; padding: 4px; }
.vm-head { display: flex; align-items: center; gap: 16px; padding: 12px; }
.vm-head-body, .vm-row-body, .vm-ver-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.vm-title { font-weight: 500; font-size: 14px; line-height: 24px; letter-spacing: -.14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vm-meta { font-size: 12px; line-height: 16px; color: var(--fg-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vm-meta.failed { color: #d93025; }
.vm-sec { display: flex; flex-direction: column; padding: 4px; }
.vm-top > .vm-sec { padding: 0; }
.vm-label { display: flex; align-items: center; justify-content: space-between; height: 36px; margin: 0; padding: 0 12px;
  font-weight: 500; font-size: 13px; line-height: 16px; color: var(--fg-2); }
.vm-copied { font-weight: 400; font-size: 12px; opacity: 0; transition: opacity .2s; }
.vm-copied.on { opacity: 1; }
.vm-prompt { position: relative; height: 126px; overflow: hidden; padding: 8px 12px; border: 0; border-radius: 12px; background: none;
  text-align: left; color: var(--fg-1); font: inherit; cursor: copy; }
.vm-prompt:hover { background: var(--surface); }
.vm-prompt-text { display: block; height: 100%; -webkit-mask-image: linear-gradient(#000 calc(100% - 32px), transparent);
  mask-image: linear-gradient(#000 calc(100% - 32px), transparent); }
.vm-prompt p { margin: 0 0 12px; font-size: 14px; line-height: 24px; letter-spacing: -.14px; }
.vm-row { display: flex; align-items: center; gap: 16px; width: 100%; padding: 12px; border: 0; border-radius: 12px; background: none;
  text-align: left; font: inherit; color: var(--fg-1); }
.vm-row:hover, .vm-row.on { background: var(--surface); }
.vm-row-label { flex: 1; min-width: 0; font-weight: 500; font-size: 13px; line-height: 16px; color: var(--fg-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vm-row-chev { flex: none; display: grid; padding: 4px; color: var(--fg-2); }
.vm-spec { border-top: 1px solid var(--stroke); }
.vm-spec-title { font-size: 13px; line-height: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-icon { position: relative; flex: none; width: 32px; height: 32px; border-radius: 3px; overflow: hidden; background: rgb(219, 237, 255); }
.doc-icon i { position: absolute; left: 3px; top: 11px; width: 26px; height: 34px; background: #fff; box-shadow: 0 0 2px rgba(0, 0, 0, .15);
  background-image: linear-gradient(rgba(0, 0, 0, .18), rgba(0, 0, 0, .18)), linear-gradient(rgba(0, 0, 0, .1), rgba(0, 0, 0, .1)),
    linear-gradient(rgba(0, 0, 0, .1), rgba(0, 0, 0, .1)), linear-gradient(rgba(0, 0, 0, .1), rgba(0, 0, 0, .1));
  background-size: 14px 2px, 18px 1px, 18px 1px, 12px 1px; background-position: 4px 5px, 4px 10px, 4px 13px, 4px 16px; background-repeat: no-repeat; }
/* the versions panel, to the right of "See previous version" */
.vm-prev-wrap { position: relative; }
.vm-sub { position: absolute; left: calc(100% + 10px); top: -4px; z-index: 11; width: 298px; max-height: 60vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 2px; padding: 4px; background: #fff; border: 1px solid var(--stroke); border-radius: 16px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .12); }
.vm-ver { display: flex; align-items: center; gap: 12px; width: 100%; padding: 4px; border: 0; border-radius: 12px; background: none;
  text-align: left; font: inherit; color: var(--fg-1); }
.vm-ver:hover, .vm-ver.on { background: var(--surface); }
.vm-ver-name { font-size: 14px; line-height: 20px; letter-spacing: -.14px; white-space: nowrap; }
.vm-ver-name .dim { margin-left: 6px; }
.vm-check { flex: none; display: grid; margin-right: 12px; color: var(--fg-1); }
/* thumb sizes: chat card 68 (default), menu header 74x72, versions panel 48, "previous" row 32 */
.vthumb-head { width: 74px; height: 72px; }
.vthumb-head img.wide { width: 58px; height: 35px; }
.vthumb-head img.tall { width: 35px; height: 58px; }
.vthumb-48 { width: 48px; height: 48px; }
.vthumb-48 img.wide { width: 38px; height: 22px; }
.vthumb-48 img.tall { width: 22px; height: 38px; }
.vthumb-48 .spin, .vthumb-32 .spin { width: 14px; height: 14px; border-width: 1.6px; }
.vthumb-32 { width: 32px; height: 32px; border-radius: 3px; }
.vthumb-32 img.wide { width: 29px; height: 17px; border-radius: 3px; }
.vthumb-32 img.tall { width: 17px; height: 29px; border-radius: 3px; }
.vthumb-32 img { box-shadow: 0 2px 5px rgba(0, 0, 0, .25); }
.vm-ver:hover .vthumb img, .vm-row:hover .vthumb img { transform: rotate(-1deg); }

/* creative spec overlay */
.spec-back { position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, .2); display: grid; place-items: center; padding: 32px; }
.spec { width: min(720px, 100%); max-height: calc(100vh - 64px); overflow-y: auto; background: #fff; border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .18); padding: 24px 32px 32px; }
.spec-head { display: flex; align-items: center; gap: 12px; }
.spec-head h2 { flex: 1; margin: 0; font-weight: 500; font-size: 24px; line-height: 40px; letter-spacing: -.72px; }
.spec-head .icon32 { font-size: 20px; color: var(--fg-2); }
.spec-meta { margin: 0 0 8px; font-size: 12px; line-height: 16px; color: var(--fg-2); }
.spec section { margin-top: 24px; }
.spec h3 { margin: 0 0 8px; font-weight: 500; font-size: 13px; line-height: 16px; color: var(--fg-2); }
.spec p { margin: 0 0 12px; font-size: 14px; line-height: 24px; letter-spacing: -.14px; }
.spec-logline { margin: 16px 0 0; font-size: 16px; line-height: 26px; letter-spacing: -.16px; color: var(--fg-1); }
.spec-note { margin: 16px 0 0; padding: 12px 16px; border-radius: 12px; background: var(--surface); font-size: 13px; line-height: 20px; color: var(--fg-2); }
.spec ol, .spec ul { margin: 0; padding-left: 20px; font-size: 14px; line-height: 24px; letter-spacing: -.14px; }
.spec li + li { margin-top: 4px; }
.spec-chars { list-style: none; padding: 0 !important; display: flex; flex-direction: column; gap: 12px; }
.spec-chars li { display: flex; gap: 12px; align-items: center; margin: 0 !important; }
.spec-chars img, .spec-noimg { flex: none; width: 48px; height: 48px; border-radius: 8px; object-fit: cover; background: var(--surface); }
.spec-chars li > span:last-child { display: flex; flex-direction: column; font-size: 13px; line-height: 20px; }
.spec-chars b { font-weight: 500; font-size: 14px; }
.spec-line { display: grid; grid-template-columns: 80px 1fr; gap: 12px; }
.spec-line .dim { font-size: 13px; }
.spec-more { margin-top: 12px; }
.spec-more summary { cursor: pointer; font-size: 13px; color: var(--fg-2); margin-bottom: 12px; }
.spec-h-row { display: flex; align-items: center; justify-content: space-between; }
.spec-copy { border: 0; border-radius: 8px; padding: 2px 8px; background: var(--surface); color: var(--fg-2); font: inherit; font-size: 12px; line-height: 20px; }
.spec-copy:hover { background: var(--surface-2); color: var(--fg-1); }
.spec-prompt, .spec-brief { padding: 12px 16px; border-radius: 12px; background: var(--surface); }
.spec-prompt p:last-child, .spec-brief p:last-child { margin-bottom: 0; }
.spec-refs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.spec-refs figure { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.spec-refs img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; background: var(--surface); display: block; }
.spec-refs figcaption { display: flex; flex-direction: column; gap: 2px; font-size: 12px; line-height: 16px; color: var(--fg-1); }
.spec-refs figcaption b { font-weight: 500; font-size: 13px; }

/* stage */
.stage { --stage-fg: var(--fg-1); --stage-muted: var(--fg-2); --stage-2: var(--surface); --stage-line: var(--stroke);
  flex: 1; background: #fff; color: var(--fg-1); min-height: 0; overflow-y: auto; display: flex; padding: 8px 16px 24px 12px; }
.stage > * { margin: auto; }
.stage-empty { display: grid; justify-items: center; gap: 14px; color: var(--stage-muted); }
.frame-ghost { height: min(60vh, 520px); max-width: 80%; border: 1px dashed var(--stage-line); border-radius: 14px; display: grid; place-items: center; color: #3a3a3a; }
.stage-empty p { margin: 0; }

.player { display: grid; justify-items: center; gap: 14px; padding: 22px; width: 100%; }
.screen { height: min(calc(100vh - 56px - 160px), 1000px); max-width: 100%; background: #000; overflow: hidden; }
.screen video { width: 100%; height: 100%; display: block; object-fit: contain; background: #000; }
.strip { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.thumb { position: relative; width: 46px; height: 64px; padding: 0; border: 2px solid transparent; border-radius: 7px; overflow: hidden; background: var(--stage-2); opacity: .7; }
.thumb:hover { opacity: 1; }
.thumb.on { border-color: var(--stage-fg); opacity: 1; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .n { position: absolute; left: 3px; bottom: 2px; font-size: 11px; font-weight: 700; color: #fff; text-shadow: 0 1px 3px #000; }
.kept-dot { position: absolute; right: 4px; top: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--stage-muted); }
.caption { font-size: 13px; color: var(--stage-muted); max-width: 560px; text-align: center; }

/* live render status */
.rstatus { width: min(760px, 100%); padding: 28px 26px; display: grid; gap: 22px; }
.rs-head { display: grid; gap: 4px; }
.rs-title { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.rs-sum { color: var(--stage-muted); }
.rs-time { font-size: 13px; color: var(--stage-muted); font-variant-numeric: tabular-nums; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.steps li { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--stage-line); font-size: 13px; color: var(--stage-muted); }
.steps li .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--stage-line); }
.steps li.done { color: var(--stage-fg); }
.steps li.done .dot { background: var(--good); }
.steps li.now { color: var(--stage-fg); border-color: var(--stage-fg); }
.steps li.failed { color: var(--bad); border-color: var(--bad); }
.steps li.failed .dot { background: var(--bad); }
.rs-sec h3 { margin: 0 0 10px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--stage-muted); }
.rs-sec h3 span { font-weight: 500; margin-left: 6px; }
.agrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.atile { margin: 0; display: grid; gap: 5px; }
.atile-img { position: relative; aspect-ratio: 1; border-radius: 9px; overflow: hidden; background: var(--stage-2); display: grid; place-items: center; }
.atile-img img { width: 100%; height: 100%; object-fit: cover; display: block; animation: fadein .4s; }
.atile.failed .atile-img { outline: 1px solid var(--bad); }
.atile figcaption { font-size: 11.5px; color: var(--stage-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.atile figcaption em { font-style: normal; color: var(--faint); }
.atile-img .spin, .atile-img .bad { position: absolute; }
.atile-img .atile-enc { position: absolute; right: 4px; bottom: 4px; width: 38%; height: auto; aspect-ratio: auto; object-fit: contain; border-radius: 5px; box-shadow: 0 1px 4px rgba(0,0,0,.45); background: #f4efe6; animation: fadein .4s; }
.bad { color: var(--bad); font-weight: 800; }
.sgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; }
.stile { position: relative; margin: 0; border-radius: 10px; overflow: hidden; background: var(--stage-2); display: grid; place-items: center; border: 1px solid var(--stage-line); }
.stile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: fadein .4s; }
.stile img.dim { opacity: .35; filter: saturate(.6); }
.stile .spin { position: relative; z-index: 1; }
.stile .n { position: absolute; left: 7px; top: 5px; font-weight: 700; font-size: 13px; text-shadow: 0 1px 3px #000; }
.stile figcaption { color: #fff; position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 7px 5px; font-size: 11.5px; background: linear-gradient(transparent, rgba(0, 0, 0, .75)); font-variant-numeric: tabular-nums; }
.stile figcaption.kept { color: var(--stage-muted); }
.stile.kept { opacity: .55; }
.stile.done { border-color: var(--good); }
.stile.failed { border-color: var(--bad); }
.tgrid { display: grid; grid-template-columns: minmax(0, 220px); }
.ttile { position: relative; margin: 0; border-radius: 12px; overflow: hidden; background: var(--stage-2); display: grid; place-items: center; border: 1px solid var(--stage-line); }
.ttile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: fadein .4s; }
.ttile .spin { position: relative; z-index: 1; width: 26px; height: 26px; }
.ttile figcaption { color: #fff; position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 9px 7px; font-size: 12.5px; background: linear-gradient(transparent, rgba(0, 0, 0, .75)); font-variant-numeric: tabular-nums; }
.ttile.done { border-color: var(--good); }
.ttile.failed { border-color: var(--bad); }
.stile-err { position: absolute; inset: 26px 6px 24px; font-size: 11px; color: #ffb4ac; overflow: hidden; z-index: 1; }
@keyframes fadein { from { opacity: 0; } }

.spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(0, 0, 0, .1); border-top-color: var(--fg-2); animation: spin .8s linear infinite; display: inline-block; flex: none; }
.spin.sm { width: 11px; height: 11px; border-width: 1.6px; }
@keyframes spin { to { transform: rotate(360deg); } }
