/* FineME v355 — product-tag fit fixes + edit-post media manager */

/* Compact product tags on main feed and community feed */
.fm-v355.fm-feed-page .fm-post-card > .fm-product-interest-form,
.fm-v355 .phase4-community-feed .fm-post-card > .fm-product-interest-form{
  width:100%!important;
  margin:0!important;
  padding:0!important;
}
.fm-v355.fm-feed-page .fm-post-card > .fm-social-product,
.fm-v355.fm-feed-page .fm-post-card > .fm-product-interest-form > .fm-social-product,
.fm-v355 .phase4-community-feed .fm-post-card > .fm-social-product,
.fm-v355 .phase4-community-feed .fm-post-card > .fm-product-interest-form > .fm-social-product{
  box-sizing:border-box!important;
  width:calc(100% - 24px)!important;
  min-height:64px!important;
  margin:8px 12px 10px!important;
  padding:7px 8px 7px 7px!important;
  display:grid!important;
  grid-template-columns:52px minmax(0,1fr) 78px!important;
  gap:9px!important;
  align-items:center!important;
  border-radius:14px!important;
  overflow:hidden!important;
}
.fm-v355.fm-feed-page .fm-post-card > .fm-social-product > img,
.fm-v355.fm-feed-page .fm-post-card > .fm-product-interest-form > .fm-social-product > img,
.fm-v355 .phase4-community-feed .fm-post-card > .fm-social-product > img,
.fm-v355 .phase4-community-feed .fm-post-card > .fm-product-interest-form > .fm-social-product > img{
  width:52px!important;height:52px!important;min-width:52px!important;min-height:52px!important;max-width:52px!important;max-height:52px!important;border-radius:11px!important;object-fit:cover!important;
}
.fm-v355.fm-feed-page .fm-post-card .fm-social-product-copy,
.fm-v355 .phase4-community-feed .fm-post-card .fm-social-product-copy{
  min-width:0!important;
  display:grid!important;
  gap:2px!important;
  align-content:center!important;
  overflow:hidden!important;
}
.fm-v355.fm-feed-page .fm-post-card .fm-social-product-copy small,
.fm-v355 .phase4-community-feed .fm-post-card .fm-social-product-copy small{
  min-width:0!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;font-size:8.5px!important;line-height:1.2!important;
}
.fm-v355.fm-feed-page .fm-post-card .fm-social-product-copy strong,
.fm-v355 .phase4-community-feed .fm-post-card .fm-social-product-copy strong{
  min-width:0!important;overflow:hidden!important;display:-webkit-box!important;-webkit-box-orient:vertical!important;-webkit-line-clamp:2!important;white-space:normal!important;font-size:11px!important;line-height:1.22!important;max-height:2.45em!important;
}
.fm-v355.fm-feed-page .fm-post-card .fm-social-product-copy em,
.fm-v355 .phase4-community-feed .fm-post-card .fm-social-product-copy em{display:none!important}
.fm-v355.fm-feed-page .fm-post-card .fm-social-product-copy > span,
.fm-v355 .phase4-community-feed .fm-post-card .fm-social-product-copy > span{
  min-width:0!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;font-size:10.25px!important;line-height:1.15!important;font-weight:900!important;
}
.fm-v355.fm-feed-page .fm-post-card .fm-social-product-cta,
.fm-v355 .phase4-community-feed .fm-post-card .fm-social-product-cta{
  min-width:74px!important;
  min-height:40px!important;
  padding:6px 7px!important;
  display:grid!important;
  place-items:center!important;
  text-align:center!important;
  gap:2px!important;
  border-radius:11px!important;
  white-space:normal!important;
  overflow:hidden!important;
  text-overflow:clip!important;
  font-size:9px!important;
  line-height:1.08!important;
  flex-shrink:0!important;
  word-break:break-word!important;
}
.fm-v355.fm-feed-page .fm-post-card button.fm-social-product,
.fm-v355 .phase4-community-feed .fm-post-card button.fm-social-product{
  appearance:none!important;-webkit-appearance:none!important;text-align:left!important;font:inherit!important;
}

/* Community feed slightly smaller */
.fm-v355 .phase4-community-feed .fm-post-card > .fm-social-product,
.fm-v355 .phase4-community-feed .fm-post-card > .fm-product-interest-form > .fm-social-product{
  width:calc(100% - 20px)!important;
  min-height:60px!important;
  margin:7px 10px 9px!important;
  grid-template-columns:48px minmax(0,1fr) 74px!important;
}
.fm-v355 .phase4-community-feed .fm-post-card > .fm-social-product > img,
.fm-v355 .phase4-community-feed .fm-post-card > .fm-product-interest-form > .fm-social-product > img{width:48px!important;height:48px!important;min-width:48px!important;min-height:48px!important;max-width:48px!important;max-height:48px!important}

@media(max-width:700px){
  .fm-v355.fm-feed-page .fm-post-card > .fm-social-product,
  .fm-v355.fm-feed-page .fm-post-card > .fm-product-interest-form > .fm-social-product,
  .fm-v355 .phase4-community-feed .fm-post-card > .fm-social-product,
  .fm-v355 .phase4-community-feed .fm-post-card > .fm-product-interest-form > .fm-social-product{
    width:calc(100% - 16px)!important;
    min-height:64px!important;
    margin:7px 8px 8px!important;
    padding:6px!important;
    grid-template-columns:46px minmax(0,1fr) 74px!important;
    gap:7px!important;
    border-radius:13px!important;
  }
  .fm-v355.fm-feed-page .fm-post-card > .fm-social-product > img,
  .fm-v355.fm-feed-page .fm-post-card > .fm-product-interest-form > .fm-social-product > img,
  .fm-v355 .phase4-community-feed .fm-post-card > .fm-social-product > img,
  .fm-v355 .phase4-community-feed .fm-post-card > .fm-product-interest-form > .fm-social-product > img{
    width:46px!important;height:46px!important;min-width:46px!important;min-height:46px!important;max-width:46px!important;max-height:46px!important;border-radius:10px!important;
  }
  .fm-v355.fm-feed-page .fm-post-card .fm-social-product-copy small,
  .fm-v355 .phase4-community-feed .fm-post-card .fm-social-product-copy small{font-size:7.8px!important}
  .fm-v355.fm-feed-page .fm-post-card .fm-social-product-copy strong,
  .fm-v355 .phase4-community-feed .fm-post-card .fm-social-product-copy strong{font-size:10.2px!important;line-height:1.18!important}
  .fm-v355.fm-feed-page .fm-post-card .fm-social-product-copy > span,
  .fm-v355 .phase4-community-feed .fm-post-card .fm-social-product-copy > span{font-size:9.7px!important}
  .fm-v355.fm-feed-page .fm-post-card .fm-social-product-cta,
  .fm-v355 .phase4-community-feed .fm-post-card .fm-social-product-cta{
    min-width:70px!important;min-height:38px!important;padding:5px 6px!important;border-radius:10px!important;font-size:8.35px!important;
  }
}

@media(max-width:390px){
  .fm-v355.fm-feed-page .fm-post-card > .fm-social-product,
  .fm-v355.fm-feed-page .fm-post-card > .fm-product-interest-form > .fm-social-product,
  .fm-v355 .phase4-community-feed .fm-post-card > .fm-social-product,
  .fm-v355 .phase4-community-feed .fm-post-card > .fm-product-interest-form > .fm-social-product{
    grid-template-columns:42px minmax(0,1fr) 68px!important;
  }
  .fm-v355.fm-feed-page .fm-post-card > .fm-social-product > img,
  .fm-v355.fm-feed-page .fm-post-card > .fm-product-interest-form > .fm-social-product > img,
  .fm-v355 .phase4-community-feed .fm-post-card > .fm-social-product > img,
  .fm-v355 .phase4-community-feed .fm-post-card > .fm-product-interest-form > .fm-social-product > img{
    width:42px!important;height:42px!important;min-width:42px!important;min-height:42px!important;max-width:42px!important;max-height:42px!important;
  }
  .fm-v355.fm-feed-page .fm-post-card .fm-social-product-cta,
  .fm-v355 .phase4-community-feed .fm-post-card .fm-social-product-cta{
    min-width:66px!important;font-size:8px!important;line-height:1.02!important;
  }
}

/* Video feed product tag: keep translation visible on mobile */
body.fm-v355 .shadow-video-product{
  width:min(304px,100%)!important;
  min-height:54px!important;
  grid-template-columns:40px minmax(0,1fr) 72px!important;
  gap:8px!important;
  padding:6px!important;
}
body.fm-v355 .shadow-video-product>img{width:40px!important;height:40px!important;border-radius:10px!important}
body.fm-v355 .shadow-video-product-copy{gap:2px!important}
body.fm-v355 .shadow-video-product-copy small{font-size:8px!important;line-height:1.12!important}
body.fm-v355 .shadow-video-product-copy strong{font-size:10px!important;line-height:1.18!important;-webkit-line-clamp:2!important}
body.fm-v355 .shadow-video-product b{min-width:70px!important;min-height:40px!important;padding:4px 6px!important;text-align:center!important}
body.fm-v355 .shadow-video-product b span{font-size:10px!important;line-height:1!important}
body.fm-v355 .shadow-video-product b em{font-size:7px!important;line-height:1.05!important;white-space:normal!important;text-align:center!important;display:block!important}
@media(max-width:700px){
  body.fm-v355 .shadow-video-product{width:min(272px,calc(100% - 4px))!important;grid-template-columns:38px minmax(0,1fr) 68px!important;min-height:50px!important;padding:5px!important}
  body.fm-v355 .shadow-video-product>img{width:38px!important;height:38px!important}
  body.fm-v355 .shadow-video-product-copy strong{font-size:9.5px!important}
  body.fm-v355 .shadow-video-product b{min-width:66px!important;min-height:36px!important}
}
@media(max-width:390px){
  body.fm-v355 .shadow-video-product{width:min(252px,calc(100% - 4px))!important;grid-template-columns:34px minmax(0,1fr) 64px!important}
  body.fm-v355 .shadow-video-product>img{width:34px!important;height:34px!important}
  body.fm-v355 .shadow-video-product-copy strong{font-size:9px!important}
  body.fm-v355 .shadow-video-product b span{font-size:9px!important}
  body.fm-v355 .shadow-video-product b em{font-size:6.5px!important}
}

/* Quick composer selected product actions */
body.fm-v355 .fm-qc-product-selected{align-items:center!important}
body.fm-v355 .fm-qc-product-selected-actions{display:grid;gap:6px;justify-items:stretch}
body.fm-v355 .fm-qc-product-selected-actions>button{border:0;border-radius:10px;background:#eef2f9;color:#44506a;padding:7px 10px;font:inherit;font-size:11px;font-weight:800;cursor:pointer;white-space:nowrap}
body.fm-v355 .fm-qc-product-selected-actions>button:hover{background:#e6ecff;color:#314399}
body.fm-v355 .fm-qc-product-selected-actions>[data-fm-qc-product-remove]:hover{background:#fff0f3;color:#bd5068}
@media(max-width:700px){body.fm-v355 .fm-qc-product-selected{grid-template-columns:46px minmax(0,1fr)!important}body.fm-v355 .fm-qc-product-selected-actions{grid-column:1/-1;grid-template-columns:1fr 1fr}}

/* Edit-post image manager */
body.fm-v355 .fm-edit-post-media{display:grid;gap:10px;margin-top:14px;padding:14px;border:1px solid #e4e8f2;border-radius:16px;background:linear-gradient(180deg,#fbfcff,#f5f7fc)}
body.fm-v355 .fm-edit-post-media-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;flex-wrap:wrap}
body.fm-v355 .fm-edit-post-media-head strong{font-size:15px;color:#1f2d48}
body.fm-v355 .fm-edit-post-media-head small{display:block;color:#76839b;line-height:1.45;margin-top:3px;max-width:520px}
body.fm-v355 .fm-edit-post-media-note{display:inline-flex;align-items:center;gap:6px;padding:7px 10px;border-radius:999px;background:#edf4ff;color:#4861d0;font-size:11px;font-weight:800;white-space:nowrap}
body.fm-v355 .fm-edit-post-media-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(96px,1fr));gap:10px}
body.fm-v355 .fm-edit-post-media-item{position:relative;border-radius:14px;overflow:hidden;background:#edf1f7;aspect-ratio:1/1;box-shadow:inset 0 0 0 1px rgba(126,140,168,.18)}
body.fm-v355 .fm-edit-post-media-item img{width:100%;height:100%;object-fit:cover;display:block}
body.fm-v355 .fm-edit-post-media-remove{position:absolute;right:8px;top:8px;border:0;border-radius:999px;padding:6px 9px;background:rgba(13,17,24,.72);color:#fff;font:inherit;font-size:11px;font-weight:800;cursor:pointer;backdrop-filter:blur(10px)}
body.fm-v355 .fm-edit-post-media-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
body.fm-v355 .fm-edit-post-media-upload{border:0;border-radius:12px;padding:10px 14px;background:linear-gradient(135deg,#5f6fff,#8c63ff);color:#fff;font:inherit;font-weight:800;cursor:pointer;box-shadow:0 10px 24px rgba(98,85,255,.22)}
body.fm-v355 .fm-edit-post-media-upload[disabled],
body.fm-v355 .fm-edit-post-media-remove[disabled]{opacity:.6;cursor:not-allowed}
body.fm-v355 .fm-edit-post-media-help{color:#7a879f;font-size:12px}
body.fm-v355 .fm-edit-post-media-empty{padding:16px;border:1px dashed #d3daea;border-radius:14px;background:#fff;color:#7b8798;text-align:center;font-size:13px}
@media(max-width:700px){
  body.fm-v355 .fm-edit-post-media{padding:12px;border-radius:14px}
  body.fm-v355 .fm-edit-post-media-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
  body.fm-v355 .fm-edit-post-media-upload{width:100%;justify-content:center;text-align:center}
}
