/* Five-pass layout audit: final authoritative desktop refinements. */
/* Compact advanced contract: selectors remain beside the preview and the
   control surface owns its vertical scroll. */
@media (max-width:1024px){
  #generatorShell.is-popup.is-advanced .wbp-controls-scroll{
    min-height:0!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    justify-content:flex-start!important;
    overscroll-behavior:contain!important;
    scrollbar-gutter:stable!important;
    padding-bottom:72px!important;
    box-sizing:border-box!important;
  }
}

/* 0.9.404: compact sticky occupies half of the mobile/tablet viewport. */
@media (max-width:1024px){
  .wbp-editor #generatorShell#generatorShell.is-preview-fixed:not(.is-popup) .wbp-stage-panel{
    height:50dvh!important;
    min-height:0!important;
    max-height:50dvh!important;
  }
}

@media (min-width:1025px){
  /* v0.9.352: desktop opens directly as the integrated workspace in simple mode. */
  #generatorShell.is-desktop-workspace:not(.is-popup):not(.is-advanced){
    grid-template-columns:minmax(360px,430px) minmax(520px,680px)!important;
    grid-template-rows:64px 620px!important;
    justify-content:center!important;
    align-items:stretch!important;
    gap:18px 22px!important;
    width:min(100%,1170px)!important;
    height:auto!important;
    min-height:738px!important;
    max-height:none!important;
    margin-inline:auto!important;
    padding:18px!important;
    overflow:visible!important;
    border-radius:30px!important;
    background:linear-gradient(145deg,#fff 0%,#fcf8ff 100%)!important;
  }
  #generatorShell.is-desktop-workspace:not(.is-popup):not(.is-advanced) .wbp-popup-title,
  #generatorShell.is-desktop-workspace:not(.is-popup):not(.is-advanced) .wbp-stage-label,
  #generatorShell.is-desktop-workspace:not(.is-popup):not(.is-advanced) .wbp-popup-close,
  #generatorShell.is-desktop-workspace:not(.is-popup):not(.is-advanced) .wbp-compact-secondary,
  #generatorShell.is-desktop-workspace:not(.is-popup):not(.is-advanced) .wbp-editor-brand{
    display:none!important;
  }
  #generatorShell.is-desktop-workspace:not(.is-popup):not(.is-advanced) .wbp-editor-topbar{
    display:flex!important;
    grid-column:1/-1!important;
    grid-row:1!important;
    width:100%!important;
    min-height:64px!important;
    padding:8px 10px 8px 18px!important;
    border:1px solid rgba(123,43,214,.12)!important;
    border-radius:18px!important;
    background:rgba(255,255,255,.9)!important;
  }
  #generatorShell.is-desktop-workspace:not(.is-popup):not(.is-advanced) .wbp-mode-pill{
    margin-left:auto!important;
  }
  #generatorShell.is-desktop-workspace:not(.is-popup):not(.is-advanced) .wbp-form-panel{
    display:flex!important;
    flex-direction:column!important;
    grid-column:1!important;
    grid-row:2!important;
    width:100%!important;
    height:620px!important;
    min-height:620px!important;
    max-height:620px!important;
    padding:16px!important;
    overflow:hidden!important;
    border:1px solid rgba(123,43,214,.14)!important;
    border-radius:22px!important;
    background:rgba(255,255,255,.88)!important;
    box-shadow:0 18px 44px rgba(50,20,95,.09)!important;
  }
  #generatorShell.is-desktop-workspace:not(.is-popup):not(.is-advanced) .wbp-controls-scroll{
    display:flex!important;
    flex-direction:column!important;
    gap:16px!important;
    width:100%!important;
    height:auto!important;
    min-height:0!important;
    overflow-y:auto!important;
  }
  #generatorShell.is-desktop-workspace:not(.is-popup):not(.is-advanced) .wbp-preview-tools{
    position:static!important;
    display:grid!important;
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    width:100%!important;
    gap:8px!important;
    margin:0!important;
  }
  #generatorShell.is-desktop-workspace:not(.is-popup):not(.is-advanced) .wbp-preview-tools .wbp-tool-card{
    display:flex!important;
    flex-direction:column!important;
    align-items:center!important;
    justify-content:center!important;
    gap:4px!important;
    width:100%!important;
    height:72px!important;
    min-height:72px!important;
  }
  #generatorShell.is-desktop-workspace:not(.is-popup):not(.is-advanced) .wbp-preview-tools .wbp-tool-card__icon{
    width:34px!important;
    height:34px!important;
  }
  #generatorShell.is-desktop-workspace:not(.is-popup):not(.is-advanced) .wbp-preview-tools .wbp-tool-card b{
    display:block!important;
    position:static!important;
    width:auto!important;
    height:auto!important;
    min-width:0!important;
    min-height:0!important;
    max-width:100%!important;
    max-height:none!important;
    margin:0!important;
    padding:0!important;
    overflow:visible!important;
    clip:auto!important;
    clip-path:none!important;
    white-space:normal!important;
    font-size:.7rem!important;
    line-height:1!important;
  }
  #generatorShell.is-desktop-workspace:not(.is-popup):not(.is-advanced) .wbp-simple-text-editor,
  #generatorShell.is-desktop-workspace:not(.is-popup):not(.is-advanced) .wbp-advanced-toggle{
    display:block!important;
  }
  #generatorShell.is-desktop-workspace:not(.is-popup):not(.is-advanced) .wbp-simple-text-editor{
    position:static!important;
    flex:0 0 auto!important;
    width:100%!important;
    height:auto!important;
    min-height:0!important;
    margin:0!important;
    padding:0!important;
  }
  #generatorShell.is-desktop-workspace:not(.is-popup):not(.is-advanced) .wbp-simple-text-editor h3{
    margin:0 0 10px!important;
  }
  #generatorShell.is-desktop-workspace:not(.is-popup):not(.is-advanced) .wbp-form-grid{
    flex:0 0 auto!important;
    display:grid!important;
    grid-template-columns:1fr 1fr!important;
    grid-template-rows:auto auto!important;
    align-content:start!important;
    gap:12px!important;
    width:100%!important;
    height:auto!important;
  }
  #generatorShell.is-desktop-workspace:not(.is-popup):not(.is-advanced) .wbp-form-grid .wbp-field:last-child{
    grid-column:1/-1!important;
  }
  #generatorShell.is-desktop-workspace:not(.is-popup):not(.is-advanced) .wbp-advanced-toggle{
    margin-top:auto!important;
  }
  #generatorShell.is-desktop-workspace:not(.is-popup):not(.is-advanced) .wbp-stage-panel{
    grid-column:2!important;
    grid-row:2!important;
    display:flex!important;
    flex-direction:column!important;
    width:100%!important;
    height:620px!important;
    min-height:620px!important;
    max-height:620px!important;
    padding:18px!important;
    overflow:hidden!important;
    border:1px solid rgba(123,43,214,.14)!important;
    border-radius:22px!important;
    background:rgba(255,255,255,.88)!important;
    box-shadow:0 18px 44px rgba(50,20,95,.09)!important;
  }
  #generatorShell.is-desktop-workspace:not(.is-popup):not(.is-advanced) .wbp-preview-layout{
    flex:1 1 auto!important;
    display:grid!important;
    grid-template-columns:1fr!important;
    place-items:center!important;
    width:100%!important;
    min-height:0!important;
    padding:0!important;
  }
  #generatorShell.is-desktop-workspace:not(.is-popup):not(.is-advanced) #previewArea{
    position:relative!important;
    width:auto!important;
    height:520px!important;
    max-width:100%!important;
    max-height:520px!important;
    margin:auto!important;
    transform:none!important;
    aspect-ratio:var(--preview-aspect,16/9)!important;
  }
  #generatorShell.is-desktop-workspace:not(.is-popup):not(.is-advanced) .wbp-compact-controls{
    position:static!important;
    inset:auto!important;
    flex:0 0 auto!important;
    width:100%!important;
    margin:16px 0 0!important;
    padding:0!important;
    transform:none!important;
    background:transparent!important;
    box-shadow:none!important;
  }
  #generatorShell.is-desktop-workspace:not(.is-popup):not(.is-advanced) .wbp-actions{
    position:static!important;
    grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr)!important;
    gap:12px!important;
    width:100%!important;
    margin:0!important;
  }

  /* v0.9.348: desktop advanced editing is an integrated workspace, not fullscreen. */
  #generatorShell.is-advanced:not(.is-popup){
    grid-template-columns:minmax(360px,430px) minmax(520px,680px)!important;
    grid-template-rows:64px 620px!important;
    justify-content:center!important;
    align-items:stretch!important;
    gap:18px 22px!important;
    width:min(100%,1170px)!important;
    margin-inline:auto!important;
    padding:18px!important;
    height:auto!important;
    min-height:738px!important;
    max-height:none!important;
    overflow:visible!important;
    border-radius:30px!important;
    background:linear-gradient(145deg,#fff 0%,#fcf8ff 100%)!important;
  }
  #generatorShell.is-advanced:not(.is-popup) .wbp-popup-title,
  #generatorShell.is-advanced:not(.is-popup) .wbp-stage-label,
  #generatorShell.is-advanced:not(.is-popup) .wbp-simple-text-editor,
  #generatorShell.is-advanced:not(.is-popup) .wbp-advanced-toggle,
  #generatorShell.is-advanced:not(.is-popup) .wbp-preview-tools,
  #generatorShell.is-advanced:not(.is-popup) .wbp-compact-secondary,
  #generatorShell.is-advanced:not(.is-popup) .wbp-editor-brand{
    display:none!important;
  }
  #generatorShell.is-advanced:not(.is-popup) .wbp-editor-topbar{
    display:flex!important;
    grid-column:1/-1!important;
    grid-row:1!important;
    width:100%!important;
    min-height:64px!important;
    padding:8px 10px 8px 18px!important;
    border:1px solid rgba(123,43,214,.12)!important;
    border-radius:18px!important;
    background:rgba(255,255,255,.9)!important;
  }
  #generatorShell.is-advanced:not(.is-popup) .wbp-editor-heading strong::after{
    content:" · Personalización avanzada";
    color:#7b2bd6;
  }
  #generatorShell.is-advanced:not(.is-popup) .wbp-mode-pill{
    margin-left:auto!important;
  }
  #generatorShell.is-advanced:not(.is-popup) .wbp-popup-close{
    display:none!important;
  }
  #generatorShell.is-advanced:not(.is-popup) .wbp-form-panel{
    display:flex!important;
    flex-direction:column!important;
    grid-column:1!important;
    grid-row:2!important;
    width:100%!important;
    min-width:0!important;
    height:620px!important;
    min-height:620px!important;
    max-height:620px!important;
    padding:10px!important;
    overflow:hidden!important;
    border:1px solid rgba(123,43,214,.14)!important;
    border-radius:22px!important;
    background:rgba(255,255,255,.88)!important;
    box-shadow:0 18px 44px rgba(50,20,95,.09)!important;
  }
  #generatorShell.is-advanced:not(.is-popup) .wbp-controls-scroll{
    width:100%!important;
    height:100%!important;
    min-height:0!important;
    overflow:hidden!important;
  }
  #generatorShell.is-advanced:not(.is-popup) #advancedOptionsPanel{
    display:flex!important;
    flex-direction:column!important;
    width:100%!important;
    height:100%!important;
    min-height:0!important;
    gap:12px!important;
    padding:0!important;
    overflow:hidden!important;
    border:0!important;
    background:transparent!important;
    box-shadow:none!important;
  }
  #generatorShell.is-advanced:not(.is-popup) .wbp-advanced-toolbar{
    position:static!important;
    display:grid!important;
    grid-template-columns:repeat(4,minmax(0,1fr)) 52px!important;
    grid-template-rows:66px!important;
    gap:7px!important;
    width:100%!important;
    height:66px!important;
    min-height:66px!important;
    overflow:visible!important;
  }
  #generatorShell.is-advanced:not(.is-popup) .wbp-advanced-tool{
    display:flex!important;
    flex-direction:column!important;
    align-items:center!important;
    justify-content:center!important;
    gap:3px!important;
    width:100%!important;
    height:66px!important;
    min-height:66px!important;
    padding:5px 3px!important;
    border-radius:14px!important;
  }
  #generatorShell.is-advanced:not(.is-popup) .wbp-advanced-tool > span{
    width:28px!important;
    height:28px!important;
    flex:0 0 28px!important;
  }
  #generatorShell.is-advanced:not(.is-popup) .wbp-advanced-tool b{
    display:block!important;
    font-size:.7rem!important;
    line-height:1!important;
  }
  #generatorShell.is-advanced:not(.is-popup) .wbp-advanced-tool small,
  #generatorShell.is-advanced:not(.is-popup) .wbp-current-target,
  #generatorShell.is-advanced:not(.is-popup) .wbp-advanced-tabs{
    display:none!important;
  }
  #generatorShell.is-advanced:not(.is-popup) .wbp-advanced-grid{
    flex:1 1 auto!important;
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    align-content:start!important;
    gap:12px 14px!important;
    width:100%!important;
    min-height:0!important;
    margin:0!important;
    padding:16px!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    overscroll-behavior:contain!important;
    scrollbar-gutter:stable!important;
    scroll-padding-bottom:24px!important;
    border:1px solid rgba(123,43,214,.1)!important;
    border-radius:18px!important;
    background:#fff!important;
  }
  #generatorShell.is-advanced:not(.is-popup) .wbp-advanced-grid > *{
    display:none!important;
  }
  #generatorShell.is-advanced:not(.is-popup)[data-advanced-panel="text"] .wbp-advanced-grid > .wbp-control-text,
  #generatorShell.is-advanced:not(.is-popup)[data-advanced-panel="text"] .wbp-advanced-grid > .wbp-control-box,
  #generatorShell.is-advanced:not(.is-popup)[data-advanced-panel="text"] .wbp-advanced-grid > .wbp-control-transform,
  #generatorShell.is-advanced:not(.is-popup)[data-advanced-panel="media"] .wbp-advanced-grid > .wbp-control-background,
  #generatorShell.is-advanced:not(.is-popup)[data-advanced-panel="media"] .wbp-advanced-grid > .wbp-control-music{
    display:grid!important;
  }
  #generatorShell.is-advanced:not(.is-popup)[data-advanced-panel="text"][data-advanced-target="mensaje"] .wbp-advanced-grid > .wbp-control-message{
    display:grid!important;
  }
  #generatorShell.is-advanced:not(.is-popup)[data-advanced-panel="text"]:not([data-advanced-target="mensaje"]) .wbp-advanced-grid > .wbp-control-message{
    display:none!important;
  }
  #generatorShell.is-advanced:not(.is-popup) .wbp-control-target{
    display:none!important;
  }
  #generatorShell.is-advanced:not(.is-popup) .wbp-advanced-actions{
    flex:0 0 auto!important;
    padding:0 2px 2px!important;
  }
  #generatorShell.is-advanced:not(.is-popup) .wbp-stage-panel{
    grid-column:2!important;
    grid-row:2!important;
    display:flex!important;
    flex-direction:column!important;
    width:100%!important;
    min-width:0!important;
    height:620px!important;
    min-height:620px!important;
    max-height:620px!important;
    padding:18px!important;
    overflow:hidden!important;
    border:1px solid rgba(123,43,214,.14)!important;
    border-radius:22px!important;
    background:rgba(255,255,255,.88)!important;
    box-shadow:0 18px 44px rgba(50,20,95,.09)!important;
  }
  #generatorShell.is-advanced:not(.is-popup) .wbp-preview-layout{
    flex:1 1 auto!important;
    display:grid!important;
    grid-template-columns:1fr!important;
    place-items:center!important;
    width:100%!important;
    min-height:0!important;
    padding:0!important;
  }
  #generatorShell.is-advanced:not(.is-popup) #previewArea{
    position:relative!important;
    width:auto!important;
    height:520px!important;
    max-width:100%!important;
    max-height:520px!important;
    aspect-ratio:var(--preview-aspect,16/9)!important;
    margin:auto!important;
    transform:none!important;
  }
  #generatorShell.is-advanced:not(.is-popup) .wbp-compact-controls{
    position:static!important;
    inset:auto!important;
    flex:0 0 auto!important;
    width:100%!important;
    margin:16px 0 0!important;
    padding:0!important;
    transform:none!important;
    background:transparent!important;
    box-shadow:none!important;
  }
  #generatorShell.is-advanced:not(.is-popup) .wbp-actions{
    position:static!important;
    display:grid!important;
    grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr)!important;
    gap:12px!important;
    width:100%!important;
    margin:0!important;
  }
  #generatorShell:not(.is-popup) .wbp-compact-fullscreen img{
    display:none!important;
  }
  #generatorShell:not(.is-popup) .wbp-compact-fullscreen span{
    display:inline!important;
  }

  /* Iteration 1: desktop-only scope; portrait mobile keeps the 0.9.342 layout. */
  #generatorShell.is-popup.is-advanced .wbp-editor-brand,
  #generatorShell.is-popup.is-advanced .wbp-compact-secondary{
    display:none!important;
  }

  /* Iteration 2: a centered, bounded preview-plus-controls workspace. */
  #generatorShell.is-popup.is-advanced{
    grid-template-columns:380px 430px!important;
    grid-template-rows:76px minmax(0,1fr) 72px!important;
    justify-content:center!important;
    column-gap:18px!important;
    padding:0 18px 8px!important;
  }
  #generatorShell.is-popup.is-advanced .wbp-editor-topbar{
    grid-column:1/-1!important;
    width:100%!important;
  }
  #generatorShell.is-popup.is-advanced .wbp-stage-panel{
    grid-column:1!important;
    grid-row:2!important;
    width:380px!important;
    min-width:0!important;
    padding:8px!important;
    overflow:hidden!important;
  }
  #generatorShell.is-popup.is-advanced .wbp-form-panel{
    grid-column:2!important;
    grid-row:2!important;
    width:430px!important;
    min-width:0!important;
    padding:8px!important;
    overflow:auto!important;
  }
  #generatorShell.is-popup.is-advanced .wbp-stage-panel .wbp-preview-layout{
    place-items:center!important;
    padding:0!important;
  }
  #generatorShell.is-popup.is-advanced .wbp-stage-panel #previewArea{
    position:absolute!important;
    inset:auto!important;
    left:50%!important;
    right:auto!important;
    top:0!important;
    bottom:auto!important;
    margin:0!important;
    transform:translateX(-50%)!important;
  }
  #generatorShell.is-popup.is-advanced .wbp-stage-panel #previewArea{
    position:static!important;
    inset:auto!important;
    margin:auto!important;
    transform:none!important;
  }

  /* Iteration 3: predictable, compact tool navigation and readable controls. */
  #generatorShell.is-popup.is-advanced #advancedOptionsPanel .wbp-advanced-toolbar{
    display:grid!important;
    grid-template-columns:repeat(5,minmax(0,1fr))!important;
    grid-template-rows:58px!important;
    gap:6px!important;
    width:100%!important;
    height:58px!important;
    min-height:58px!important;
    overflow:visible!important;
  }
  #generatorShell.is-popup.is-advanced #advancedOptionsPanel .wbp-advanced-tool{
    display:flex!important;
    flex-direction:column!important;
    align-items:center!important;
    justify-content:center!important;
    gap:2px!important;
    width:100%!important;
    height:58px!important;
    min-height:58px!important;
    padding:4px 3px!important;
    overflow:hidden!important;
  }
  #generatorShell.is-popup.is-advanced #advancedOptionsPanel .wbp-advanced-tool > span{
    width:28px!important;
    height:28px!important;
    flex:0 0 28px!important;
  }
  #generatorShell.is-popup.is-advanced #advancedOptionsPanel .wbp-advanced-tool b{
    display:block!important;
    max-width:100%!important;
    font-size:.68rem!important;
    line-height:1.05!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }
  #generatorShell.is-popup.is-advanced #advancedOptionsPanel .wbp-advanced-tool small{
    display:none!important;
  }
  #generatorShell.is-popup.is-advanced #advancedOptionsPanel .wbp-advanced-grid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:12px 14px!important;
    padding:12px!important;
    align-content:start!important;
  }

  /* Iteration 4: actions belong to the whole workspace, not the preview alone. */
  #generatorShell.is-popup.is-advanced .wbp-stage-panel .wbp-compact-controls,
  .wbp-editor #generatorShell.is-popup.is-advanced .wbp-compact-controls{
    left:50%!important;
    right:auto!important;
    bottom:10px!important;
    width:828px!important;
    max-width:calc(100vw - 36px)!important;
    transform:translateX(-50%)!important;
  }
  #generatorShell.is-popup.is-advanced .wbp-stage-panel .wbp-compact-controls .wbp-actions{
    grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr)!important;
  }

  /* Iteration 5: consistent surface hierarchy and restrained visual polish. */
  #generatorShell.is-popup.is-advanced .wbp-stage-panel,
  #generatorShell.is-popup.is-advanced .wbp-form-panel{
    border:1px solid rgba(123,43,214,.14)!important;
    border-radius:22px!important;
    background:rgba(255,255,255,.76)!important;
    box-shadow:0 18px 44px rgba(50,20,95,.09)!important;
  }
  #generatorShell.is-popup.is-advanced #advancedOptionsPanel{
    border:0!important;
    border-radius:16px!important;
    box-shadow:none!important;
    background:transparent!important;
  }
  #generatorShell.is-popup.is-advanced #advancedOptionsPanel .wbp-advanced-tool{
    border-radius:14px!important;
  }
  #generatorShell.is-popup.is-advanced #advancedOptionsPanel .wbp-advanced-tool.is-active{
    background:linear-gradient(180deg,#fff,#f7efff)!important;
  }
}

/* Compact advanced workspace: selector rail | preview, then controls. */
@media (max-width:1024px){
  #generatorShell.is-popup.is-advanced{
    grid-template-columns:76px minmax(0,1fr)!important;
    grid-template-rows:52px minmax(0,42dvh) minmax(0,1fr)!important;
    gap:8px!important;
    padding:6px!important;
  }
  #generatorShell.is-popup.is-advanced .wbp-editor-topbar{
    grid-column:1/-1!important;
    grid-row:1!important;
    min-height:52px!important;
  }
  #generatorShell.is-popup.is-advanced .wbp-stage-panel{
    position:relative!important;
    inset:auto!important;
    left:auto!important;
    right:auto!important;
    top:auto!important;
    bottom:auto!important;
    grid-column:2!important;
    grid-row:2!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    height:100%!important;
    margin:0!important;
    padding:0!important;
    justify-self:stretch!important;
    transform:none!important;
    overflow:hidden!important;
  }
  #generatorShell.is-popup.is-advanced .wbp-stage-panel .wbp-preview-layout{
    position:relative!important;
    inset:auto!important;
    display:block!important;
    width:100%!important;
    height:100%!important;
    margin:0!important;
    padding:0!important;
    transform:none!important;
  }
  #generatorShell.is-popup.is-advanced .wbp-stage-panel #previewArea{
    position:absolute!important;
    inset:auto!important;
    left:50%!important;
    right:auto!important;
    top:0!important;
    bottom:auto!important;
    margin:0!important;
    transform:translateX(-50%)!important;
  }
  #generatorShell.is-popup.is-advanced .wbp-form-panel,
  #generatorShell.is-popup.is-advanced .wbp-controls-scroll,
  #generatorShell.is-popup.is-advanced #advancedOptionsPanel{
    display:contents!important;
  }
  #generatorShell.is-popup.is-advanced #advancedOptionsPanel .wbp-advanced-toolbar{
    position:static!important;
    grid-column:1!important;
    grid-row:2!important;
    display:grid!important;
    grid-template-columns:1fr!important;
    grid-template-rows:repeat(5,minmax(0,1fr))!important;
    gap:5px!important;
    width:76px!important;
    height:100%!important;
    min-height:0!important;
    margin:0!important;
    padding:0!important;
    overflow:hidden!important;
  }
  #generatorShell.is-popup.is-advanced #advancedOptionsPanel .wbp-advanced-tool{
    width:76px!important;
    height:auto!important;
    min-height:0!important;
    padding:3px!important;
    border-radius:13px!important;
  }
  #generatorShell.is-popup.is-advanced #advancedOptionsPanel .wbp-advanced-tool > span{
    width:27px!important;
    height:27px!important;
    flex:0 0 27px!important;
  }
  #generatorShell.is-popup.is-advanced #advancedOptionsPanel .wbp-advanced-tool b{
    font-size:9px!important;
    line-height:1!important;
  }
  #generatorShell.is-popup.is-advanced .wbp-current-target,
  #generatorShell.is-popup.is-advanced .wbp-advanced-tabs{
    display:none!important;
  }
  #generatorShell.is-popup.is-advanced #advancedOptionsPanel .wbp-advanced-grid{
    position:static!important;
    grid-column:1/-1!important;
    grid-row:3!important;
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    align-content:start!important;
    gap:10px!important;
    width:100%!important;
    height:100%!important;
    min-height:0!important;
    margin:0!important;
    padding:10px 9px 82px!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
  }
  #generatorShell.is-popup.is-advanced[data-advanced-panel="text"] .wbp-advanced-grid > .wbp-control-text,
  #generatorShell.is-popup.is-advanced[data-advanced-panel="text"] .wbp-advanced-grid > .wbp-control-box,
  #generatorShell.is-popup.is-advanced[data-advanced-panel="text"] .wbp-advanced-grid > .wbp-control-transform,
  #generatorShell.is-popup.is-advanced[data-advanced-panel="media"] .wbp-advanced-grid > .wbp-control-background,
  #generatorShell.is-popup.is-advanced[data-advanced-panel="media"] .wbp-advanced-grid > .wbp-control-music{
    display:grid!important;
  }
  #generatorShell.is-popup.is-advanced[data-advanced-panel="text"] .wbp-advanced-grid label:has(#advancedStrokeColor),
  #generatorShell.is-popup.is-advanced[data-advanced-panel="text"] .wbp-advanced-grid label:has(#advancedStrokeWidth){
    display:grid!important;
  }
  #generatorShell.is-popup.is-advanced[data-advanced-panel="text"][data-advanced-target="mensaje"] .wbp-advanced-grid > .wbp-control-message{
    display:grid!important;
  }
  #generatorShell.is-popup.is-advanced[data-advanced-panel="text"]:not([data-advanced-target="mensaje"]) .wbp-advanced-grid > .wbp-control-message{
    display:none!important;
  }
  #generatorShell.is-popup.is-advanced .wbp-advanced-grid > .wbp-advanced-section-title,
  #generatorShell.is-popup.is-advanced .wbp-advanced-grid > .wbp-advanced-message-field{
    grid-column:1/-1!important;
  }
  #generatorShell.is-popup.is-advanced .wbp-advanced-actions{
    position:fixed!important;
    left:8px!important;
    right:8px!important;
    bottom:66px!important;
    z-index:75!important;
    margin:0!important;
    padding:0!important;
  }
}

/* v0.9.358: final authoritative fidelity and collision corrections. */
#previewArea{
  aspect-ratio:var(--preview-aspect,.5625)!important;
}

@media (max-width:1024px){
  #generatorShell.is-popup{
    max-width:100vw!important;
    overflow-x:clip!important;
  }
  #generatorShell.is-popup .wbp-stage-panel,
  #generatorShell.is-popup .wbp-preview-layout{
    min-width:0!important;
    max-width:100%!important;
  }
  #generatorShell.is-popup:not(.is-advanced) #previewArea,
  #generatorShell.is-popup.is-advanced #previewArea{
    width:auto!important;
    height:auto!important;
    max-width:100%!important;
    max-height:100%!important;
    aspect-ratio:var(--preview-aspect,.5625)!important;
    margin:auto!important;
  }
  #generatorShell.is-popup.is-advanced .wbp-editor-brand{
    display:none!important;
  }
  #generatorShell.is-popup.is-advanced .wbp-compact-controls{
    overflow:hidden!important;
  }
}

#generatorShell .wbp-advanced-actions #advancedReset{
  min-height:44px!important;
}

@media (max-width:1024px){
  #previewArea .wbp-preview-fullscreen-btn{
    width:calc(44px * var(--wbp-inverse-zoom,1))!important;
    height:calc(44px * var(--wbp-inverse-zoom,1))!important;
    min-width:calc(44px * var(--wbp-inverse-zoom,1))!important;
    min-height:calc(44px * var(--wbp-inverse-zoom,1))!important;
  }
}

/* v0.9.371: preserve the control scroller and keep its final action reachable. */
@media(max-width:767px){
  .wbp-editor #generatorShell.is-popup.is-advanced .wbp-stage-panel .wbp-compact-controls{
    z-index:2147483001!important;
  }
  .wbp-editor #generatorShell.is-popup.is-advanced .wbp-form-panel{
    z-index:auto!important;
    overflow:hidden!important;
  }
  .wbp-editor #generatorShell.is-popup.is-advanced .wbp-controls-scroll,
  .wbp-editor #generatorShell.is-popup.is-advanced #advancedOptionsPanel,
  .wbp-editor #generatorShell.is-popup.is-advanced .wbp-advanced-panel{
    height:100%!important;
    min-height:0!important;
    overflow:hidden!important;
  }
  .wbp-editor #generatorShell.is-popup.is-advanced .wbp-advanced-grid{
    min-height:0!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    overscroll-behavior:contain!important;
    -webkit-overflow-scrolling:touch!important;
    scroll-padding-bottom:160px!important;
    padding-bottom:0!important;
  }
  .wbp-editor #generatorShell.is-popup.is-advanced .wbp-advanced-grid label:has(#advancedRotation){
    margin-bottom:160px!important;
  }
  .wbp-editor #generatorShell.is-popup.is-advanced .wbp-advanced-actions{
    position:static!important;
    grid-column:1/-1!important;
    order:999!important;
    display:block!important;
    width:100%!important;
    margin:8px 0 0!important;
    padding:6px!important;
    border-radius:16px!important;
    background:rgba(255,255,255,.98)!important;
    box-shadow:none!important;
  }
  .wbp-editor #generatorShell.is-popup.is-advanced .wbp-advanced-actions .wbp-mini-btn{
    display:inline-flex!important;
    width:100%!important;
    min-height:44px!important;
    align-items:center!important;
    justify-content:center!important;
  }
}

#generatorShell.is-preview-fullscreening{
  background:#08050d!important;
}

/* Desktop Simple is a responsive single-screen workspace. */
@media (min-width:1025px){
  #generatorShell.is-desktop-workspace:not(.is-popup):not(.is-advanced) .wbp-controls-scroll{
    justify-content:space-between!important;
    gap:6px!important;
    overflow-x:hidden!important;
    overflow-y:hidden!important;
  }
  #generatorShell.is-desktop-workspace:not(.is-popup):not(.is-advanced) .wbp-preview-tools .wbp-tool-card{
    height:56px!important;
    min-height:56px!important;
  }
  #generatorShell.is-desktop-workspace:not(.is-popup):not(.is-advanced) .wbp-preview-tools .wbp-tool-card__icon{
    width:30px!important;
    height:30px!important;
  }
  #generatorShell.is-desktop-workspace:not(.is-popup):not(.is-advanced) .wbp-simple-text-editor h3{
    margin-bottom:6px!important;
  }
  #generatorShell.is-desktop-workspace:not(.is-popup):not(.is-advanced) .wbp-form-grid{
    gap:8px 10px!important;
  }
  #generatorShell.is-desktop-workspace:not(.is-popup):not(.is-advanced) .wbp-field{
    gap:4px!important;
  }
  #generatorShell.is-desktop-workspace:not(.is-popup):not(.is-advanced) .wbp-field input{
    min-height:42px!important;
  }
  #generatorShell.is-desktop-workspace:not(.is-popup):not(.is-advanced) .wbp-field textarea{
    min-height:60px!important;
    height:60px!important;
  }
}

/* Responsive advanced contract: the control grid owns vertical scrolling.
   Headings and long-form content keep the full control width. */
@media (max-width:1024px){
  .wbp-editor #generatorShell.is-popup.is-advanced .wbp-controls-scroll,
  .wbp-editor #generatorShell.is-popup.is-advanced #advancedOptionsPanel{
    min-height:0!important;
    overflow:hidden!important;
  }
  .wbp-editor #generatorShell.is-popup.is-advanced .wbp-advanced-grid{
    min-height:0!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    overscroll-behavior:contain!important;
    -webkit-overflow-scrolling:touch!important;
    scrollbar-gutter:stable!important;
    scroll-padding-block:12px 112px!important;
    padding-bottom:112px!important;
  }
  .wbp-editor #generatorShell.is-popup.is-advanced .wbp-advanced-section-title,
  .wbp-editor #generatorShell.is-popup.is-advanced .wbp-advanced-message-field{
    grid-column:1/-1!important;
    width:100%!important;
    min-width:0!important;
  }
  .wbp-editor #generatorShell.is-popup.is-advanced .wbp-advanced-message-field textarea{
    width:100%!important;
    min-width:0!important;
  }
  .wbp-editor #generatorShell.is-popup.is-advanced[data-advanced-panel="text"] .wbp-advanced-grid > .wbp-control-text,
  .wbp-editor #generatorShell.is-popup.is-advanced[data-advanced-panel="text"] .wbp-advanced-grid > .wbp-control-box,
  .wbp-editor #generatorShell.is-popup.is-advanced[data-advanced-panel="text"] .wbp-advanced-grid > .wbp-control-transform{
    display:grid!important;
  }
  .wbp-editor #generatorShell.is-popup.is-advanced[data-advanced-panel="text"][data-advanced-target="mensaje"] .wbp-advanced-grid > .wbp-control-message{
    display:grid!important;
  }
  .wbp-editor #generatorShell.is-popup.is-advanced[data-advanced-panel="text"] .wbp-advanced-grid label:has(#advancedScale){
    display:grid!important;
  }
}
/* 0.9.522 final render/result lock. This file loads after editor.css. */
.wbp-editor #generatorShell:is(.is-video-generating,.is-video-ready,.is-video-error,.is-video-protected),
#generatorShell:is(.is-video-generating,.is-video-ready,.is-video-error,.is-video-protected){
  display:grid!important;
  grid-template-columns:1fr!important;
  grid-template-rows:auto auto!important;
  gap:16px!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  overflow:visible!important;
  cursor:default!important;
}
.wbp-editor #generatorShell:is(.is-video-generating,.is-video-ready,.is-video-error,.is-video-protected) .wbp-editor-topbar,
#generatorShell:is(.is-video-generating,.is-video-ready,.is-video-error,.is-video-protected) .wbp-editor-topbar{
  display:grid!important;
  grid-column:1/-1!important;
}
.wbp-editor #generatorShell:is(.is-video-generating,.is-video-ready,.is-video-error,.is-video-protected) .wbp-mode-switch,
.wbp-editor #generatorShell:is(.is-video-generating,.is-video-ready,.is-video-error,.is-video-protected) .wbp-form-panel,
.wbp-editor #generatorShell:is(.is-video-generating,.is-video-ready,.is-video-error,.is-video-protected) .wbp-stage-label,
.wbp-editor #generatorShell:is(.is-video-generating,.is-video-ready,.is-video-error,.is-video-protected) .wbp-preview-layout,
.wbp-editor #generatorShell:is(.is-video-generating,.is-video-ready,.is-video-error,.is-video-protected) .wbp-video-container,
.wbp-editor #generatorShell:is(.is-video-generating,.is-video-ready,.is-video-error,.is-video-protected) .wbp-preview-tools,
.wbp-editor #generatorShell:is(.is-video-generating,.is-video-ready,.is-video-error,.is-video-protected) .wbp-compact-secondary,
#generatorShell:is(.is-video-generating,.is-video-ready,.is-video-error,.is-video-protected) .wbp-mode-switch,
#generatorShell:is(.is-video-generating,.is-video-ready,.is-video-error,.is-video-protected) .wbp-form-panel,
#generatorShell:is(.is-video-generating,.is-video-ready,.is-video-error,.is-video-protected) .wbp-stage-label,
#generatorShell:is(.is-video-generating,.is-video-ready,.is-video-error,.is-video-protected) .wbp-preview-layout,
#generatorShell:is(.is-video-generating,.is-video-ready,.is-video-error,.is-video-protected) .wbp-video-container,
#generatorShell:is(.is-video-generating,.is-video-ready,.is-video-error,.is-video-protected) .wbp-preview-tools,
#generatorShell:is(.is-video-generating,.is-video-ready,.is-video-error,.is-video-protected) .wbp-compact-secondary{
  display:none!important;
}
.wbp-editor #generatorShell:is(.is-video-generating,.is-video-ready,.is-video-error,.is-video-protected) .wbp-stage-panel,
#generatorShell:is(.is-video-generating,.is-video-ready,.is-video-error,.is-video-protected) .wbp-stage-panel{
  grid-column:1/-1!important;
  position:static!important;
  inset:auto!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  gap:12px!important;
  width:100%!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  overflow:visible!important;
  padding:20px!important;
}
.wbp-editor #generatorShell:is(.is-video-generating,.is-video-ready,.is-video-error,.is-video-protected) .wbp-render-snapshot-frame,
#generatorShell:is(.is-video-generating,.is-video-ready,.is-video-error,.is-video-protected) .wbp-render-snapshot-frame{
  display:block!important;
  order:1!important;
  width:min(100%,280px)!important;
  margin:0 auto!important;
  text-align:center!important;
}
.wbp-editor #generatorShell:is(.is-video-generating,.is-video-ready,.is-video-error,.is-video-protected) .wbp-render-snapshot-frame[hidden],
#generatorShell:is(.is-video-generating,.is-video-ready,.is-video-error,.is-video-protected) .wbp-render-snapshot-frame[hidden]{
  display:none!important;
}
.wbp-editor #generatorShell:is(.is-video-generating,.is-video-ready,.is-video-error,.is-video-protected) .wbp-render-snapshot-frame img,
#generatorShell:is(.is-video-generating,.is-video-ready,.is-video-error,.is-video-protected) .wbp-render-snapshot-frame img{
  display:block!important;
  width:min(100%,220px)!important;
  max-width:220px!important;
  max-height:42vh!important;
  aspect-ratio:9/16!important;
  height:auto!important;
  object-fit:cover!important;
  margin:0 auto!important;
}
.wbp-editor #generatorShell:is(.is-video-generating,.is-video-ready,.is-video-error,.is-video-protected) .wbp-compact-controls,
#generatorShell:is(.is-video-generating,.is-video-ready,.is-video-error,.is-video-protected) .wbp-compact-controls{
  order:2!important;
  position:static!important;
  inset:auto!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  gap:10px!important;
  width:min(100%,560px)!important;
  max-width:560px!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  margin:0 auto!important;
  padding:0!important;
  transform:none!important;
  overflow:visible!important;
  background:transparent!important;
  border:0!important;
  border-radius:0!important;
  box-shadow:none!important;
}
.wbp-editor #generatorShell:is(.is-video-generating,.is-video-ready,.is-video-error,.is-video-protected) .wbp-actions,
#generatorShell:is(.is-video-generating,.is-video-ready,.is-video-error,.is-video-protected) .wbp-actions{
  position:static!important;
  inset:auto!important;
  display:flex!important;
  justify-content:center!important;
  width:100%!important;
  max-width:100%!important;
  margin:0!important;
  padding:0!important;
  transform:none!important;
  background:transparent!important;
  border:0!important;
  border-radius:0!important;
  box-shadow:none!important;
}
.wbp-editor #generatorShell.is-video-generating .wbp-progress,
.wbp-editor #generatorShell:is(.is-video-ready,.is-video-error,.is-video-protected) .wbp-status,
#generatorShell.is-video-generating .wbp-progress,
#generatorShell:is(.is-video-ready,.is-video-error,.is-video-protected) .wbp-status{
  width:100%!important;
  max-width:520px!important;
  margin:0 auto!important;
}
.wbp-editor #generatorShell.is-video-ready #downloadVideo,
.wbp-editor #generatorShell.is-video-error #retryRender,
#generatorShell.is-video-ready #downloadVideo,
#generatorShell.is-video-error #retryRender{
  width:min(100%,300px)!important;
  min-height:56px!important;
  justify-content:center!important;
}
.wbp-editor #generatorShell:not(.is-video-ready):not(.is-video-error):not(.is-video-protected) #editAgain,
#generatorShell:not(.is-video-ready):not(.is-video-error):not(.is-video-protected) #editAgain,
#editAgain[hidden]{
  display:none!important;
}
.wbp-editor #generatorShell:is(.is-video-ready,.is-video-error,.is-video-protected) #editAgain,
#generatorShell:is(.is-video-ready,.is-video-error,.is-video-protected) #editAgain{
  display:inline-flex!important;
  width:min(100%,260px)!important;
  min-height:52px!important;
  justify-content:center!important;
}
@media(max-width:640px){
  .wbp-editor #generatorShell:is(.is-video-ready,.is-video-error,.is-video-protected) #editAgain,
  #generatorShell:is(.is-video-ready,.is-video-error,.is-video-protected) #editAgain{
    width:100%!important;
  }
}
.wbp-editor #generatorShell.is-video-ready .wbp-render-recovery-note,
#generatorShell.is-video-ready .wbp-render-recovery-note{
  width:min(100%,520px)!important;
  margin:0 auto!important;
  padding:0 4px!important;
}
@media(max-width:760px){
  .wbp-editor #generatorShell:is(.is-video-generating,.is-video-ready,.is-video-error,.is-video-protected),
  #generatorShell:is(.is-video-generating,.is-video-ready,.is-video-error,.is-video-protected){
    gap:10px!important;
    padding:12px!important;
  }
  .wbp-editor #generatorShell.is-popup:is(.is-video-generating,.is-video-ready,.is-video-error,.is-video-protected),
  #generatorShell.is-popup:is(.is-video-generating,.is-video-ready,.is-video-error,.is-video-protected){
    width:100vw!important;
    height:100dvh!important;
    max-height:100dvh!important;
    overflow:auto!important;
    grid-template-rows:auto minmax(0,1fr)!important;
  }
  .wbp-editor #generatorShell:is(.is-video-generating,.is-video-ready,.is-video-error,.is-video-protected) .wbp-stage-panel,
  #generatorShell:is(.is-video-generating,.is-video-ready,.is-video-error,.is-video-protected) .wbp-stage-panel{
    padding:14px 12px calc(16px + env(safe-area-inset-bottom,0px))!important;
    justify-content:flex-start!important;
  }
  .wbp-editor #generatorShell:is(.is-video-generating,.is-video-ready,.is-video-error,.is-video-protected) .wbp-render-snapshot-frame img,
  #generatorShell:is(.is-video-generating,.is-video-ready,.is-video-error,.is-video-protected) .wbp-render-snapshot-frame img{
    width:min(58vw,200px)!important;
    max-width:200px!important;
    max-height:34dvh!important;
  }
}
@media(max-width:380px), (max-height:700px){
  .wbp-editor #generatorShell:is(.is-video-generating,.is-video-ready,.is-video-error,.is-video-protected) .wbp-render-snapshot-frame img,
  #generatorShell:is(.is-video-generating,.is-video-ready,.is-video-error,.is-video-protected) .wbp-render-snapshot-frame img{
    width:min(50vw,166px)!important;
    max-width:166px!important;
    max-height:30dvh!important;
  }
}
/* 0.9.523: beat desktop-workspace selectors during render/result. */
@media(min-width:1025px){
  .wbp-editor #generatorShell.is-desktop-workspace.is-video-generating:not(.is-popup),
  .wbp-editor #generatorShell.is-desktop-workspace.is-video-ready:not(.is-popup),
  .wbp-editor #generatorShell.is-desktop-workspace.is-video-error:not(.is-popup),
  .wbp-editor #generatorShell.is-desktop-workspace.is-video-protected:not(.is-popup),
  #generatorShell.is-desktop-workspace.is-video-generating:not(.is-popup),
  #generatorShell.is-desktop-workspace.is-video-ready:not(.is-popup),
  #generatorShell.is-desktop-workspace.is-video-error:not(.is-popup),
  #generatorShell.is-desktop-workspace.is-video-protected:not(.is-popup){
    grid-template-columns:1fr!important;
    grid-template-rows:auto auto!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    overflow:visible!important;
  }
  .wbp-editor #generatorShell.is-desktop-workspace.is-video-generating:not(.is-popup) .wbp-form-panel,
  .wbp-editor #generatorShell.is-desktop-workspace.is-video-ready:not(.is-popup) .wbp-form-panel,
  .wbp-editor #generatorShell.is-desktop-workspace.is-video-error:not(.is-popup) .wbp-form-panel,
  .wbp-editor #generatorShell.is-desktop-workspace.is-video-protected:not(.is-popup) .wbp-form-panel,
  .wbp-editor #generatorShell.is-desktop-workspace.is-video-generating:not(.is-popup) .wbp-preview-layout,
  .wbp-editor #generatorShell.is-desktop-workspace.is-video-ready:not(.is-popup) .wbp-preview-layout,
  .wbp-editor #generatorShell.is-desktop-workspace.is-video-error:not(.is-popup) .wbp-preview-layout,
  .wbp-editor #generatorShell.is-desktop-workspace.is-video-protected:not(.is-popup) .wbp-preview-layout,
  .wbp-editor #generatorShell.is-desktop-workspace.is-video-generating:not(.is-popup) .wbp-video-container,
  .wbp-editor #generatorShell.is-desktop-workspace.is-video-ready:not(.is-popup) .wbp-video-container,
  .wbp-editor #generatorShell.is-desktop-workspace.is-video-error:not(.is-popup) .wbp-video-container,
  .wbp-editor #generatorShell.is-desktop-workspace.is-video-protected:not(.is-popup) .wbp-video-container,
  #generatorShell.is-desktop-workspace.is-video-generating:not(.is-popup) .wbp-form-panel,
  #generatorShell.is-desktop-workspace.is-video-ready:not(.is-popup) .wbp-form-panel,
  #generatorShell.is-desktop-workspace.is-video-error:not(.is-popup) .wbp-form-panel,
  #generatorShell.is-desktop-workspace.is-video-protected:not(.is-popup) .wbp-form-panel,
  #generatorShell.is-desktop-workspace.is-video-generating:not(.is-popup) .wbp-preview-layout,
  #generatorShell.is-desktop-workspace.is-video-ready:not(.is-popup) .wbp-preview-layout,
  #generatorShell.is-desktop-workspace.is-video-error:not(.is-popup) .wbp-preview-layout,
  #generatorShell.is-desktop-workspace.is-video-protected:not(.is-popup) .wbp-preview-layout,
  #generatorShell.is-desktop-workspace.is-video-generating:not(.is-popup) .wbp-video-container,
  #generatorShell.is-desktop-workspace.is-video-ready:not(.is-popup) .wbp-video-container,
  #generatorShell.is-desktop-workspace.is-video-error:not(.is-popup) .wbp-video-container,
  #generatorShell.is-desktop-workspace.is-video-protected:not(.is-popup) .wbp-video-container{
    display:none!important;
  }
  .wbp-editor #generatorShell.is-desktop-workspace.is-video-generating:not(.is-popup) .wbp-stage-panel,
  .wbp-editor #generatorShell.is-desktop-workspace.is-video-ready:not(.is-popup) .wbp-stage-panel,
  .wbp-editor #generatorShell.is-desktop-workspace.is-video-error:not(.is-popup) .wbp-stage-panel,
  .wbp-editor #generatorShell.is-desktop-workspace.is-video-protected:not(.is-popup) .wbp-stage-panel,
  #generatorShell.is-desktop-workspace.is-video-generating:not(.is-popup) .wbp-stage-panel,
  #generatorShell.is-desktop-workspace.is-video-ready:not(.is-popup) .wbp-stage-panel,
  #generatorShell.is-desktop-workspace.is-video-error:not(.is-popup) .wbp-stage-panel,
  #generatorShell.is-desktop-workspace.is-video-protected:not(.is-popup) .wbp-stage-panel{
    grid-column:1/-1!important;
    width:100%!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    overflow:visible!important;
  }
}
.wbp-video-journey-active .cnr-back-to-top{
  display:none!important;
}

/* 0.9.531 final mobile simple authority: preview, tools, actions in one readable flow. */
@media(max-width:640px){
  #generatorShell.is-popup:not(.is-advanced):not(.is-video-generating):not(.is-video-ready):not(.is-video-error):not(.is-video-protected){grid-template-rows:56px auto auto!important;overflow-y:auto!important;align-content:start!important}
  #generatorShell.is-popup:not(.is-advanced):not(.is-video-generating):not(.is-video-ready):not(.is-video-error):not(.is-video-protected) .wbp-stage-panel{position:static!important;display:grid!important;grid-template-rows:auto auto!important;gap:10px!important;height:auto!important;max-height:none!important;overflow:visible!important}
  #generatorShell.is-popup:not(.is-advanced):not(.is-video-generating):not(.is-video-ready):not(.is-video-error):not(.is-video-protected) .wbp-preview-layout{grid-row:1!important;display:grid!important;grid-template-columns:1fr!important;grid-template-rows:auto 48px!important;gap:8px!important;place-items:center!important;height:auto!important;min-height:0!important;max-height:none!important;overflow:visible!important}
  #generatorShell.is-popup:not(.is-advanced):not(.is-video-generating):not(.is-video-ready):not(.is-video-error):not(.is-video-protected) .wbp-preview-tools.wbp-simple-tools{position:static!important;inset:auto!important;transform:none!important;grid-row:2!important;display:grid!important;grid-template-columns:repeat(4,44px)!important;gap:8px!important;justify-content:center!important;width:auto!important;height:48px!important;margin:0 auto!important;padding:0!important;overflow:visible!important}
  #generatorShell.is-popup:not(.is-advanced) .wbp-preview-tools.wbp-simple-tools .wbp-tool-card{position:static!important;inset:auto!important;width:44px!important;height:44px!important;min-height:44px!important;border-radius:14px!important;transform:none!important}
  #generatorShell.is-popup:not(.is-advanced) .wbp-preview-tools.wbp-simple-tools .wbp-tool-card__icon,#generatorShell.is-popup:not(.is-advanced) .wbp-preview-tools.wbp-simple-tools .wbp-tool-card__media{width:26px!important;height:26px!important;max-width:26px!important;max-height:26px!important}
  #generatorShell.is-popup:not(.is-advanced) .wbp-compact-secondary{display:none!important}
  #generatorShell.is-popup:not(.is-advanced) .wbp-compact-controls{position:static!important;inset:auto!important;grid-row:2!important;display:grid!important;width:100%!important;max-width:370px!important;height:auto!important;min-height:0!important;max-height:none!important;margin:0 auto!important;padding:0!important;transform:none!important;background:transparent!important;border:0!important;box-shadow:none!important;overflow:visible!important}
  #generatorShell.is-popup:not(.is-advanced) .wbp-actions{position:static!important;inset:auto!important;display:grid!important;grid-template-columns:minmax(0,.96fr) minmax(0,1.04fr)!important;gap:9px!important;width:100%!important;margin:0!important;padding:7px!important;transform:none!important;border-radius:17px!important;background:rgba(255,255,255,.96)!important;box-shadow:0 10px 28px rgba(45,20,78,.12)!important}
  #generatorShell.is-popup:not(.is-advanced) .wbp-actions .wbp-btn{min-width:0!important;min-height:42px!important;padding:0 8px!important;gap:6px!important;border-radius:14px!important;font-size:12px!important;line-height:1.05!important;white-space:nowrap!important}
}
@media(max-width:360px){
  #generatorShell.is-popup:not(.is-advanced) .wbp-preview-tools.wbp-simple-tools{grid-template-columns:repeat(4,40px)!important;gap:7px!important;height:44px!important}
  #generatorShell.is-popup:not(.is-advanced) .wbp-preview-tools.wbp-simple-tools .wbp-tool-card{width:40px!important;height:40px!important;min-height:40px!important}
  #generatorShell.is-popup:not(.is-advanced) #downloadImage span{font-size:0!important}
  #generatorShell.is-popup:not(.is-advanced) #downloadImage span::after{content:"Imagen";font-size:12px!important;line-height:1!important}
}

/* 0.9.537 final authority: Simple popup must not lose controls below the viewport. */
@media(max-width:900px){
  .wbp-editor #generatorShell.is-popup:not(.is-advanced):not(.is-video-generating):not(.is-video-ready):not(.is-video-error):not(.is-video-protected),
  #generatorShell.is-popup:not(.is-advanced):not(.is-video-generating):not(.is-video-ready):not(.is-video-error):not(.is-video-protected){
    display:grid!important;
    grid-template-rows:56px auto minmax(0,1fr)!important;
    grid-template-columns:1fr!important;
    gap:8px!important;
    width:100vw!important;
    height:100dvh!important;
    min-height:0!important;
    max-height:100dvh!important;
    overflow:hidden!important;
    padding:8px 10px max(8px,env(safe-area-inset-bottom,0px))!important;
  }

  .wbp-editor #generatorShell.is-popup:not(.is-advanced):not(.is-video-generating):not(.is-video-ready):not(.is-video-error):not(.is-video-protected) .wbp-stage-panel,
  #generatorShell.is-popup:not(.is-advanced):not(.is-video-generating):not(.is-video-ready):not(.is-video-error):not(.is-video-protected) .wbp-stage-panel{
    grid-column:1!important;
    grid-row:2!important;
    position:static!important;
    display:grid!important;
    grid-template-rows:auto auto!important;
    gap:8px!important;
    width:100%!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    margin:0!important;
    padding:0!important;
    overflow:visible!important;
  }

  .wbp-editor #generatorShell.is-popup:not(.is-advanced):not(.is-video-generating):not(.is-video-ready):not(.is-video-error):not(.is-video-protected) .wbp-preview-layout,
  #generatorShell.is-popup:not(.is-advanced):not(.is-video-generating):not(.is-video-ready):not(.is-video-error):not(.is-video-protected) .wbp-preview-layout{
    grid-column:1!important;
    grid-row:1!important;
    display:grid!important;
    grid-template-columns:1fr!important;
    grid-template-rows:auto 46px!important;
    gap:7px!important;
    place-items:center!important;
    width:100%!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    margin:0!important;
    padding:0!important;
    overflow:visible!important;
  }

  .wbp-editor #generatorShell.is-popup:not(.is-advanced) .wbp-preview-tools.wbp-simple-tools,
  #generatorShell.is-popup:not(.is-advanced) .wbp-preview-tools.wbp-simple-tools{
    grid-column:1!important;
    grid-row:2!important;
    position:static!important;
    inset:auto!important;
    display:grid!important;
    grid-template-columns:repeat(4,42px)!important;
    gap:7px!important;
    justify-content:center!important;
    justify-self:center!important;
    align-self:center!important;
    width:auto!important;
    height:46px!important;
    min-height:0!important;
    max-height:none!important;
    margin:0 auto!important;
    padding:0!important;
    transform:none!important;
    overflow:visible!important;
  }

  .wbp-editor #generatorShell.is-popup:not(.is-advanced) .wbp-preview-tools.wbp-simple-tools .wbp-tool-card,
  #generatorShell.is-popup:not(.is-advanced) .wbp-preview-tools.wbp-simple-tools .wbp-tool-card{
    width:42px!important;
    height:42px!important;
    min-height:42px!important;
    padding:4px!important;
    border-radius:14px!important;
  }

  .wbp-editor #generatorShell.is-popup:not(.is-advanced) .wbp-compact-secondary,
  #generatorShell.is-popup:not(.is-advanced) .wbp-compact-secondary,
  .wbp-editor #generatorShell.is-popup:not(.is-advanced) .wbp-editor-brand,
  #generatorShell.is-popup:not(.is-advanced) .wbp-editor-brand,
  .wbp-editor #generatorShell.is-popup:not(.is-advanced) .wbp-ai-disclosure,
  #generatorShell.is-popup:not(.is-advanced) .wbp-ai-disclosure,
  .wbp-editor #generatorShell.is-popup:not(.is-advanced) .wbp-ai-credit,
  #generatorShell.is-popup:not(.is-advanced) .wbp-ai-credit{
    display:none!important;
  }

  .wbp-editor #generatorShell.is-popup:not(.is-advanced) .wbp-compact-controls,
  #generatorShell.is-popup:not(.is-advanced) .wbp-compact-controls{
    grid-column:1!important;
    grid-row:2!important;
    position:static!important;
    inset:auto!important;
    display:grid!important;
    gap:6px!important;
    width:min(370px,100%)!important;
    max-width:370px!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    margin:0 auto!important;
    padding:0!important;
    transform:none!important;
    background:transparent!important;
    border:0!important;
    box-shadow:none!important;
    overflow:visible!important;
  }

  .wbp-editor #generatorShell.is-popup:not(.is-advanced) .wbp-actions,
  #generatorShell.is-popup:not(.is-advanced) .wbp-actions{
    position:static!important;
    inset:auto!important;
    display:grid!important;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;
    gap:8px!important;
    width:100%!important;
    margin:0!important;
    padding:7px!important;
    transform:none!important;
    border-radius:16px!important;
    background:rgba(255,255,255,.97)!important;
    box-shadow:0 10px 26px rgba(45,20,78,.12)!important;
  }

  .wbp-editor #generatorShell.is-popup:not(.is-advanced) .wbp-actions .wbp-btn,
  #generatorShell.is-popup:not(.is-advanced) .wbp-actions .wbp-btn{
    min-width:0!important;
    min-height:40px!important;
    padding:0 7px!important;
    gap:5px!important;
    border-radius:13px!important;
    font-size:12px!important;
    line-height:1.05!important;
    white-space:nowrap!important;
  }

  .wbp-editor #generatorShell.is-popup:not(.is-advanced) .wbp-form-panel,
  #generatorShell.is-popup:not(.is-advanced) .wbp-form-panel{
    grid-column:1!important;
    grid-row:3!important;
    position:static!important;
    display:block!important;
    width:100%!important;
    height:100%!important;
    min-height:0!important;
    max-height:100%!important;
    margin:0!important;
    padding:0 1px 6px!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    -webkit-overflow-scrolling:touch!important;
    overscroll-behavior:contain!important;
  }

  .wbp-editor #generatorShell.is-popup:not(.is-advanced) .wbp-controls-scroll,
  #generatorShell.is-popup:not(.is-advanced) .wbp-controls-scroll{
    display:block!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    padding:0!important;
    overflow:visible!important;
  }

  .wbp-editor #generatorShell.is-popup:not(.is-advanced) .wbp-simple-text-editor,
  #generatorShell.is-popup:not(.is-advanced) .wbp-simple-text-editor{
    display:block!important;
    height:auto!important;
    min-height:0!important;
    margin:0!important;
  }

  .wbp-editor #generatorShell.is-popup:not(.is-advanced) .wbp-form-grid,
  #generatorShell.is-popup:not(.is-advanced) .wbp-form-grid{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:10px!important;
    height:auto!important;
    min-height:0!important;
  }
}

@media(max-width:360px){
  .wbp-editor #generatorShell.is-popup:not(.is-advanced) .wbp-preview-tools.wbp-simple-tools,
  #generatorShell.is-popup:not(.is-advanced) .wbp-preview-tools.wbp-simple-tools{
    grid-template-columns:repeat(4,40px)!important;
    height:42px!important;
    gap:6px!important;
  }

  .wbp-editor #generatorShell.is-popup:not(.is-advanced) .wbp-preview-tools.wbp-simple-tools .wbp-tool-card,
  #generatorShell.is-popup:not(.is-advanced) .wbp-preview-tools.wbp-simple-tools .wbp-tool-card{
    width:40px!important;
    height:40px!important;
    min-height:40px!important;
  }
}

/* 0.9.539: render/result screens are standalone, without stray editor headings. */
.wbp-editor #generatorShell:is(.is-video-generating,.is-video-ready,.is-video-error,.is-video-protected) .wbp-editor-topbar,
#generatorShell:is(.is-video-generating,.is-video-ready,.is-video-error,.is-video-protected) .wbp-editor-topbar,
.wbp-editor #generatorShell:is(.is-video-generating,.is-video-ready,.is-video-error,.is-video-protected) .wbp-editor-heading,
#generatorShell:is(.is-video-generating,.is-video-ready,.is-video-error,.is-video-protected) .wbp-editor-heading{
  display:none!important;
}

@media(max-width:900px){
  .wbp-editor #generatorShell.is-popup:is(.is-video-generating,.is-video-ready,.is-video-error,.is-video-protected) .wbp-form-panel,
  #generatorShell.is-popup:is(.is-video-generating,.is-video-ready,.is-video-error,.is-video-protected) .wbp-form-panel,
  .wbp-editor #generatorShell.is-popup:is(.is-video-generating,.is-video-ready,.is-video-error,.is-video-protected) .wbp-controls-scroll,
  #generatorShell.is-popup:is(.is-video-generating,.is-video-ready,.is-video-error,.is-video-protected) .wbp-controls-scroll,
  .wbp-editor #generatorShell.is-popup:is(.is-video-generating,.is-video-ready,.is-video-error,.is-video-protected) .wbp-simple-text-editor,
  #generatorShell.is-popup:is(.is-video-generating,.is-video-ready,.is-video-error,.is-video-protected) .wbp-simple-text-editor{
    display:none!important;
  }
}

/* 0.9.541: restore the approved simple-editor geometry from 0.9.513/0.9.515.
   Simple config tools belong beside the preview, never below it. Render/result
   states are excluded so they remain a single focused snapshot/download screen. */
@media(max-width:900px){
  .wbp-editor #generatorShell.is-popup:not(.is-advanced):not(.is-video-generating):not(.is-video-ready):not(.is-video-error):not(.is-video-protected),
  #generatorShell.is-popup:not(.is-advanced):not(.is-video-generating):not(.is-video-ready):not(.is-video-error):not(.is-video-protected){
    grid-template-rows:56px minmax(0,1fr) minmax(0,auto)!important;
    overflow:hidden!important;
  }

  .wbp-editor #generatorShell.is-popup:not(.is-advanced):not(.is-video-generating):not(.is-video-ready):not(.is-video-error):not(.is-video-protected) .wbp-stage-panel,
  #generatorShell.is-popup:not(.is-advanced):not(.is-video-generating):not(.is-video-ready):not(.is-video-error):not(.is-video-protected) .wbp-stage-panel{
    display:grid!important;
    grid-template-rows:minmax(0,1fr) auto!important;
    gap:8px!important;
    height:100%!important;
    min-height:0!important;
    overflow:hidden!important;
  }

  .wbp-editor #generatorShell.is-popup:not(.is-advanced):not(.is-video-generating):not(.is-video-ready):not(.is-video-error):not(.is-video-protected) .wbp-preview-layout,
  #generatorShell.is-popup:not(.is-advanced):not(.is-video-generating):not(.is-video-ready):not(.is-video-error):not(.is-video-protected) .wbp-preview-layout{
    grid-row:1!important;
    display:grid!important;
    grid-template-columns:minmax(0,auto) 62px!important;
    grid-template-rows:minmax(0,1fr)!important;
    gap:8px!important;
    place-items:center!important;
    align-items:center!important;
    justify-content:center!important;
    width:100%!important;
    height:100%!important;
    min-height:0!important;
    max-height:100%!important;
    margin:0!important;
    padding:0!important;
    overflow:hidden!important;
  }

  .wbp-editor #generatorShell.is-popup:not(.is-advanced):not(.is-video-generating):not(.is-video-ready):not(.is-video-error):not(.is-video-protected) #previewArea,
  #generatorShell.is-popup:not(.is-advanced):not(.is-video-generating):not(.is-video-ready):not(.is-video-error):not(.is-video-protected) #previewArea{
    grid-column:1!important;
    grid-row:1!important;
    width:auto!important;
    height:100%!important;
    min-height:0!important;
    max-height:100%!important;
    max-width:calc(100vw - 94px)!important;
    margin:0!important;
    transform:none!important;
  }

  .wbp-editor #generatorShell.is-popup:not(.is-advanced):not(.is-video-generating):not(.is-video-ready):not(.is-video-error):not(.is-video-protected) .wbp-preview-tools.wbp-simple-tools,
  #generatorShell.is-popup:not(.is-advanced):not(.is-video-generating):not(.is-video-ready):not(.is-video-error):not(.is-video-protected) .wbp-preview-tools.wbp-simple-tools{
    grid-column:2!important;
    grid-row:1!important;
    position:static!important;
    inset:auto!important;
    display:grid!important;
    grid-template-columns:1fr!important;
    grid-auto-rows:minmax(42px,1fr)!important;
    gap:6px!important;
    align-content:center!important;
    justify-content:center!important;
    justify-self:start!important;
    align-self:stretch!important;
    width:62px!important;
    height:100%!important;
    min-height:0!important;
    max-height:100%!important;
    margin:0!important;
    padding:0!important;
    transform:none!important;
    overflow:hidden!important;
  }

  .wbp-editor #generatorShell.is-popup:not(.is-advanced) .wbp-preview-tools.wbp-simple-tools .wbp-tool-card,
  #generatorShell.is-popup:not(.is-advanced) .wbp-preview-tools.wbp-simple-tools .wbp-tool-card{
    position:static!important;
    inset:auto!important;
    width:56px!important;
    min-width:0!important;
    height:auto!important;
    min-height:42px!important;
    max-height:56px!important;
    margin:0!important;
    padding:4px!important;
    transform:none!important;
    overflow:hidden!important;
  }

  .wbp-editor #generatorShell.is-popup:not(.is-advanced) .wbp-preview-tools.wbp-simple-tools .wbp-tool-card b,
  #generatorShell.is-popup:not(.is-advanced) .wbp-preview-tools.wbp-simple-tools .wbp-tool-card b{
    display:none!important;
  }

  .wbp-editor #generatorShell.is-popup:not(.is-advanced) .wbp-preview-tools.wbp-simple-tools .wbp-tool-card__icon,
  .wbp-editor #generatorShell.is-popup:not(.is-advanced) .wbp-preview-tools.wbp-simple-tools .wbp-tool-card__media,
  #generatorShell.is-popup:not(.is-advanced) .wbp-preview-tools.wbp-simple-tools .wbp-tool-card__icon,
  #generatorShell.is-popup:not(.is-advanced) .wbp-preview-tools.wbp-simple-tools .wbp-tool-card__media{
    width:28px!important;
    height:28px!important;
    max-width:28px!important;
    max-height:28px!important;
  }

  .wbp-editor #generatorShell.is-popup:not(.is-advanced) .wbp-compact-controls,
  #generatorShell.is-popup:not(.is-advanced) .wbp-compact-controls{
    grid-row:2!important;
    width:min(390px,100%)!important;
    max-width:390px!important;
    margin:0 auto!important;
  }

  .wbp-editor #generatorShell.is-popup:not(.is-advanced) .wbp-form-panel,
  #generatorShell.is-popup:not(.is-advanced) .wbp-form-panel{
    grid-row:3!important;
    height:auto!important;
    max-height:min(30dvh,230px)!important;
  }
}

@media(max-width:360px){
  .wbp-editor #generatorShell.is-popup:not(.is-advanced):not(.is-video-generating):not(.is-video-ready):not(.is-video-error):not(.is-video-protected) .wbp-preview-layout,
  #generatorShell.is-popup:not(.is-advanced):not(.is-video-generating):not(.is-video-ready):not(.is-video-error):not(.is-video-protected) .wbp-preview-layout{
    grid-template-columns:minmax(0,auto) 56px!important;
    gap:6px!important;
  }

  .wbp-editor #generatorShell.is-popup:not(.is-advanced):not(.is-video-generating):not(.is-video-ready):not(.is-video-error):not(.is-video-protected) #previewArea,
  #generatorShell.is-popup:not(.is-advanced):not(.is-video-generating):not(.is-video-ready):not(.is-video-error):not(.is-video-protected) #previewArea{
    max-width:calc(100vw - 84px)!important;
  }

  .wbp-editor #generatorShell.is-popup:not(.is-advanced):not(.is-video-generating):not(.is-video-ready):not(.is-video-error):not(.is-video-protected) .wbp-preview-tools.wbp-simple-tools,
  #generatorShell.is-popup:not(.is-advanced):not(.is-video-generating):not(.is-video-ready):not(.is-video-error):not(.is-video-protected) .wbp-preview-tools.wbp-simple-tools{
    width:56px!important;
    gap:5px!important;
  }

  .wbp-editor #generatorShell.is-popup:not(.is-advanced) .wbp-preview-tools.wbp-simple-tools .wbp-tool-card,
  #generatorShell.is-popup:not(.is-advanced) .wbp-preview-tools.wbp-simple-tools .wbp-tool-card{
    width:50px!important;
    min-height:38px!important;
    max-height:50px!important;
  }
}
