/* Facebook: ảnh và video giữ đủ khung hình ở mọi tỷ lệ, vùng media cân giữa. */
body[data-route="content"] #page-body .content-v140 #publish-preview[data-preview-channel="facebook"]
  .content-preview-hero:has(.content-preview-video-wrap, .content-preview-main-grid){
  display:block!important;
  width:calc(100% - 20px)!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  aspect-ratio:auto!important;
  margin:0 10px 8px!important;
  padding:0!important;
  box-sizing:border-box!important;
  overflow:hidden!important;
  background:#061321!important;
}
body[data-route="content"] #page-body .content-v140 #publish-preview[data-preview-channel="facebook"]
  .content-preview-stage:has(.content-preview-video-wrap, .content-preview-main-grid){
  display:flex!important;
  flex-direction:column!important;
  width:100%!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  box-sizing:border-box!important;
  overflow:hidden!important;
}
body[data-route="content"] #page-body .content-v140 #publish-preview[data-preview-channel="facebook"]
  .content-preview-primary:has(.content-preview-video-wrap, .content-preview-main-grid){
  display:flex!important;
  flex:0 0 auto!important;
  align-items:center!important;
  justify-content:center!important;
  width:100%!important;
  height:clamp(320px,38vw,520px)!important;
  min-height:0!important;
  max-height:520px!important;
  padding:10px!important;
  box-sizing:border-box!important;
  overflow:hidden!important;
  background:#050f1d!important;
}
body[data-route="content"] #page-body .content-v140 #publish-preview[data-preview-channel="facebook"]
  .content-preview-main-grid,
body[data-route="content"] #page-body .content-v140 #publish-preview[data-preview-channel="facebook"]
  .content-preview-main-grid .content-preview-image-cell,
body[data-route="content"] #page-body .content-v140 #publish-preview[data-preview-channel="facebook"]
  .content-preview-video-wrap{
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  flex:1 1 auto!important;
  width:100%!important;
  height:100%!important;
  min-width:0!important;
  min-height:0!important;
  max-width:100%!important;
  max-height:100%!important;
  margin:0 auto!important;
  overflow:hidden!important;
  box-sizing:border-box!important;
  background:#030b17!important;
}
body[data-route="content"] #page-body .content-v140 #publish-preview[data-preview-channel="facebook"]
  .content-preview-main-grid .content-preview-image-cell img,
body[data-route="content"] #page-body .content-v140 #publish-preview[data-preview-channel="facebook"]
  .content-preview-video-wrap video{
  display:block!important;
  flex:0 1 auto!important;
  width:100%!important;
  height:100%!important;
  min-width:0!important;
  min-height:0!important;
  max-width:100%!important;
  max-height:100%!important;
  margin:auto!important;
  object-fit:contain!important;
  object-position:center center!important;
  background:#030b17!important;
}
body[data-route="content"] #page-body .content-v140 #publish-preview[data-preview-channel="facebook"]
  .content-preview-selector{
  position:relative!important;
  flex:0 0 auto!important;
  width:100%!important;
  min-width:0!important;
  height:auto!important;
  box-sizing:border-box!important;
  overflow-x:auto!important;
}

/* Hai công cụ giữ lại: xóa nội dung để viết lại, và gợi ý Hashtag AI. */
body[data-route="content"] #page-body .content-v140 .v4-ai-toolbar [data-v4-ai-mode="shorten"],
body[data-route="content"] #page-body .content-v140 .v4-ai-toolbar [data-v4-ai-mode="voice"]{
  display:none!important;
}
body[data-route="content"] #page-body .content-v140 .v4-ai-toolbar{
  display:flex!important;gap:9px!important;flex-wrap:wrap!important;
}
body[data-route="content"] #page-body .content-v140 .v4-ai-toolbar button:not([hidden]){
  min-height:38px!important;padding:0 14px!important;font-size:13px!important;
}

/* Liên kết do người dùng lưu hiển thị cùng danh sách Sản phẩm trong bộ chọn. */
body[data-route="content"] #page-body .content-v140 .bv97-product-save,
body[data-route="content"] #page-body .content-v140 .bv97-linked-products{
  margin:10px 0 0;min-width:0;box-sizing:border-box;
}
body[data-route="content"] #page-body .content-v140 .bv97-product-save{
  display:grid;grid-template-columns:minmax(0,1fr) auto;gap:9px;align-items:end;
}
body[data-route="content"] #page-body .content-v140 .bv97-product-save label{
  display:grid;gap:5px;min-width:0;color:#d8eaff;font-size:12px;font-weight:600;
}
body[data-route="content"] #page-body .content-v140 .bv97-product-save input{
  box-sizing:border-box;width:100%;height:39px;padding:0 11px;
  border:1px solid #376080;border-radius:9px;background:#112b45;color:#fff;font:inherit;
}
body[data-route="content"] #page-body .content-v140 .bv97-product-save button{
  height:39px;padding:0 13px;border:1px solid #2999f5;border-radius:9px;
  background:#087bd3;color:#fff;font-weight:700;cursor:pointer;
}
body[data-route="content"] #page-body .content-v140 .bv97-product-status{
  grid-column:1/-1;min-height:16px;color:#a9d8f4;font-size:11px;
}
body[data-route="content"] #page-body .content-v140 .bv97-linked-products{
  display:grid;gap:7px;
}
body[data-route="content"] #page-body .content-v140 .bv97-linked-products:empty{display:none}
body[data-route="content"] #page-body .content-v140 .bv97-linked-products>strong{
  color:#dceeff;font-size:12px;
}
body[data-route="content"] #page-body .content-v140 .bv97-linked-row{
  display:flex;align-items:center;gap:6px;min-width:0;
}
body[data-route="content"] #page-body .content-v140 .bv97-linked-row button{
  border:1px solid #356087;border-radius:8px;background:#112a43;color:#e7f5ff;
  min-height:37px;cursor:pointer;
}
body[data-route="content"] #page-body .content-v140 .bv97-linked-row .bv97-use{
  flex:1;min-width:0;text-align:left;padding:7px 11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
body[data-route="content"] #page-body .content-v140 .bv97-linked-row .bv97-remove{
  flex:0 0 37px;font-size:18px;color:#ffc5c5;
}
body[data-route="content"] #modal-root .content-media-picker-modal .bv97-saved-item{
  text-align:left;cursor:pointer;
}
body[data-route="content"] #modal-root .content-media-picker-modal .bv97-saved-item small{
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%;
}
@media(max-width:600px){
  body[data-route="content"] #page-body .content-v140 #publish-preview[data-preview-channel="facebook"]
    .content-preview-primary:has(.content-preview-video-wrap, .content-preview-main-grid){
    height:clamp(300px,95vw,460px)!important;max-height:460px!important;
  }
  body[data-route="content"] #page-body .content-v140 .bv97-product-save{
    grid-template-columns:minmax(0,1fr);
  }
}
