:root { color-scheme:light; color:#181818; background:#fff; font-family:Arial,Helvetica,sans-serif; }
* { box-sizing:border-box; }
body { margin:0; font-size:1rem; line-height:1.5; }
a { color:inherit; text-underline-offset:.25em; }
button,select,input { font:inherit; }
button,select { min-height:44px; }
button { cursor:pointer; border:1px solid #ccc; border-radius:100px; background:#fff; color:#181818; padding:.5rem 1rem; }
button:hover:not(:disabled) { background:#181818; color:#fff; }
button:disabled,select:disabled { opacity:.5; }
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible { outline:2px solid #2451b9; outline-offset:3px; }
.demo-shell { width:min(1440px,100%); margin:auto; padding:clamp(1rem,3vw,3rem); }
.demo-header { display:flex; justify-content:space-between; align-items:center; gap:1.5rem; margin-bottom:2rem; }
.demo-header a,.eyebrow { font-size:.875rem; }
.eyebrow { color:#626262; margin:0 0 .5rem; }
h1 { font-weight:500; font-size:clamp(1.8rem,4vw,3rem); line-height:1.15; letter-spacing:-.045em; margin:0; }
.selection-panel { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,2fr); gap:1rem; }
.selection-panel label { display:grid; gap:.4rem; font-size:.875rem; min-width:0; }
select { width:100%; border:1px solid #ccc; padding:.5rem .7rem; border-radius:8px; background:#fff; color:#181818; text-overflow:ellipsis; }
.preview-heading { display:flex; align-items:center; justify-content:space-between; gap:1rem; color:#626262; font-size:.875rem; }
.preview-heading p { margin:1rem 0; }
.preview-stage { height:clamp(300px,56vh,620px); display:flex; align-items:center; justify-content:center; overflow:hidden; background:#eee; border-radius:16px; position:relative; padding:1rem; }
#viewport { flex-shrink:0; position:relative; overflow:hidden; background:#000; }
#creative { position:absolute; left:0; top:0; transform-origin:top left; border:0; pointer-events:none; }
#loading { position:absolute; background:#fff; color:#181818; padding:.7rem 1rem; border-radius:8px; max-width:calc(100% - 2rem); text-align:center; }
#loading[hidden] { display:none; }
.transport { display:flex; align-items:center; flex-wrap:wrap; gap:.75rem; margin:1rem 0; }
.timeline-label { flex:1; min-width:100px; }
#timeline { width:100%; accent-color:#2451b9; display:block; min-height:44px; margin:0; }
#time { font-size:.875rem; font-variant-numeric:tabular-nums; min-width:110px; }
.endframe-label { display:flex; align-items:center; gap:.4rem; font-size:.875rem; min-height:44px; }
.endframe-label input { width:18px; height:18px; accent-color:#2451b9; }
.prompt-caption { font-size:1rem; max-width:64rem; margin:1.5rem 0 1rem; }
.demo-note { font-size:.875rem; color:#626262; max-width:64rem; }
.open-demo { display:none; font-size:.875rem; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; border:0; }
html.embedded, html.embedded body { height:100%; }
html.embedded .demo-shell { padding:1.25rem; height:100%; display:flex; flex-direction:column; }
html.embedded main { flex:1; min-height:0; display:flex; flex-direction:column; }
html.embedded .demo-header { display:none; }
html.embedded .preview-stage { flex:1 1 0; height:auto; min-height:230px; border-radius:10px; }
html.embedded .preview-heading p { margin:.75rem 0; }
html.embedded .transport { margin:.75rem 0 .5rem; }
html.embedded .selection-panel { grid-template-columns:1fr 1fr; gap:.6rem; }
html.embedded .placement-label { grid-column:1/-1; }
html.embedded .prompt-caption,html.embedded .demo-note { display:none; }
html.embedded .open-demo { display:inline-block; }
@media(min-width:651px) {
  html.embedded .selection-panel { grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,2fr); }
  html.embedded .placement-label { grid-column:auto; }
}
@media(max-width:650px) {
  .demo-header { align-items:flex-start; flex-direction:column; }
  .selection-panel { grid-template-columns:1fr 1fr; gap:.75rem; }
  .placement-label { grid-column:1/-1; }
  .preview-stage { height:380px; }
  .timeline-label { order:4; flex-basis:100%; }
  #time { margin-left:auto; }
  .endframe-label { order:5; }
}
/* Wide screens: the controls move into a sidebar so the preview stage gets the full height.
   Narrower screens keep the stacked controls, because most placements are wide banners that need the width. */
@media(min-width:1100px) {
  main, html.embedded main { display:grid; grid-template-columns:18rem minmax(0,1fr); grid-template-rows:auto auto auto auto 1fr auto; grid-template-areas:"controls stage" "meta stage" "transport stage" "prompt stage" "note stage" "open stage"; column-gap:1.5rem; }
  .selection-panel, html.embedded .selection-panel { grid-area:controls; grid-template-columns:minmax(0,1fr); gap:.75rem; }
  .placement-label, html.embedded .placement-label { grid-column:auto; }
  .preview-heading { grid-area:meta; flex-direction:column; align-items:flex-start; gap:.15rem; margin:1rem 0 .25rem; }
  .preview-heading p, html.embedded .preview-heading p { margin:0; }
  /* contain:size stops the scaled creative from feeding back into the stage size. */
  .preview-stage { grid-area:stage; height:clamp(480px,calc(100vh - 12rem),820px); min-height:0; contain:size; }
  html.embedded .preview-stage { height:auto; min-height:0; }
  .transport { grid-area:transport; }
  .timeline-label { order:4; flex-basis:100%; }
  #time { margin-left:auto; min-width:0; }
  .endframe-label { order:5; }
  .prompt-caption { grid-area:prompt; margin:1rem 0 .75rem; }
  .demo-note { grid-area:note; margin:0; }
  .open-demo { grid-area:open; }
}
