/* FG-SPLIT-COMMUNITY: codice che stava dentro public/community.php (corsa 5, 52 blocchi), spostato qui dall'installer.
   I valori del PHP arrivano da window.__FG_PG. */
.slide-caption{display:none!important}.carousel-capbar{padding:8px 14px;font-size:.85rem;line-height:1.45;color:#4a3b2a;background:#faf8f5;border-top:1px solid #f0ece5}

.slide-caption{display:none!important}.carousel-capbar{display:none!important}

/* FIX stacking-context da filter: le foto sovrapposte restano sopra */
#postBoothGrid{position:relative;z-index:50;isolation:isolate}
#postBoothGrid img{position:relative;z-index:51}
#previewContainer img.filter-none{filter:none}

/* WB reels views */ body.wb-on .pm-views, html[data-wb] .pm-views {display:none !important}

/* CAROUSEL NO-ZOOM v2: foto intere, contenitore che si adatta (niente bande enormi), frecce dentro i bordi */
.carousel img, .carousel-item img, [id^="carousel-"] img { object-fit: contain !important; background: #000; max-height: 72vh; }
.post .media-wrap:has(.carousel), .post .media-wrap:has([id^="carousel-"]) { height: auto !important; aspect-ratio: auto !important; max-height: 72vh; }
.carousel, [id^="carousel-"] { overflow-x: auto; overflow-y: hidden; position: relative; max-width: 100%; }
.carousel-nav { position: absolute; z-index: 5; }
.carousel-nav.prev { left: 8px !important; }
.carousel-nav.next { right: 8px !important; }
.media-wrap { overflow: hidden !important; }

/* FGD6 draw-bar over overlay-btn (desktop+mobile) */ .draw-tools-bar.active{z-index:30 !important;pointer-events:auto !important;flex-direction:column !important;align-items:center !important;gap:8px !important;top:108px !important;right:8px !important;left:auto !important;bottom:auto !important;width:44px !important;padding:8px 4px !important;border-radius:22px !important} .draw-tools-bar.active #drawStrokeCount{display:none !important} .draw-tools-bar.active{height:auto !important;max-height:none !important;overflow:visible !important;flex-wrap:nowrap !important} .draw-tools-bar.active > *{flex-shrink:0 !important} .draw-tools-bar.active > div{display:flex !important;flex-direction:column !important;gap:8px !important;align-items:center !important} .draw-tools-bar.active input[type=range]{width:80px !important;transform:rotate(90deg);margin:28px 0 !important} .draw-tools-bar.active #drawStrokeCount{display:block !important;font-size:.6rem !important;writing-mode:vertical-rl;padding:4px 0 !important} .draw-tools-bar.active .dc{width:24px !important;height:24px !important} .draw-tools-bar.active button{pointer-events:auto !important} #storyModal .fgd-ovbtn{margin-top:10px}

/* TEXTBAR-V1: barra testo verticale a destra (come la barra disegno) */
.fg-textbar{position:absolute;top:60px;right:8px;z-index:18;display:none;flex-direction:column;gap:8px;
  background:rgba(0,0,0,.72);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);
  padding:8px 6px;border-radius:22px;pointer-events:auto}
.fg-textbar.show{display:flex}
.fg-textbar button{width:40px;height:40px;border-radius:50%;border:none;background:rgba(255,255,255,.15);
  color:#fff;font-size:1rem;font-weight:700;cursor:pointer;display:flex;align-items:center;justify-content:center;
  -webkit-tap-highlight-color:transparent;touch-action:manipulation}
.fg-textbar button:active{transform:scale(.92)}
.fg-textbar .fg-bg-0{background:rgba(255,255,255,.15)}
.fg-textbar .fg-bg-1{background:#fff;color:#111}
.fg-textbar .fg-bg-2{background:rgba(255,255,255,.45);color:#111}
/* il vecchio Aa in alto a destra sparisce: ora vive nella barra */
.st-text-btn.fg-moved{position:static!important;top:auto!important;right:auto!important;width:40px!important;height:40px!important}
/* stili sfondo testo, stile Instagram */
.st-text-item.fgbg-1{background:#fff;color:#111!important;padding:6px 12px!important;border-radius:10px}
.st-text-item.fgbg-2{background:rgba(255,255,255,.45);color:#111!important;padding:6px 12px!important;border-radius:10px}
.st-text-item.fgbg-0{background:transparent;text-shadow:0 2px 8px rgba(0,0,0,.7)}

/* TEXTBAR-V2: palette sfondo completa */
.fg-bgpal{position:absolute;top:60px;right:56px;z-index:19;display:none;flex-direction:column;gap:6px;
  background:rgba(0,0,0,.8);backdrop-filter:blur(10px);padding:8px 6px;border-radius:18px;max-height:60%;overflow-y:auto}
.fg-bgpal.show{display:flex}
.fg-bgpal i{width:30px;height:30px;border-radius:50%;display:block;cursor:pointer;border:2px solid rgba(255,255,255,.5)}
.fg-bgpal i.none{background:repeating-linear-gradient(45deg,#666,#666 4px,#999 4px,#999 8px);position:relative}

/* TEXTBAR-V3: sticker nella barra */
.fg-textbar .stk-t, .fg-textbar #stkTrig{
  position:static!important;top:auto!important;right:auto!important;left:auto!important;bottom:auto!important;
  width:40px!important;height:40px!important;border-radius:50%!important;
  background:rgba(255,255,255,.15)!important;color:#fff!important;border:none!important;
  font-size:1.1rem!important;display:flex!important;align-items:center;justify-content:center;
  margin:0!important;padding:0!important;opacity:1!important;visibility:visible!important}

/* TEXTBAR-V4: posizione pulita, centrata verticalmente a destra */
.fg-textbar{
  top:50%!important; transform:translateY(-50%);
  right:10px!important; bottom:auto!important;
  background:rgba(0,0,0,.55)!important;
  padding:7px 5px!important;
  box-shadow:0 4px 16px rgba(0,0,0,.35);
}
/* la palette si apre accanto, alla stessa altezza */
.fg-bgpal{ top:50%!important; transform:translateY(-50%); right:60px!important; }
/* se il banner bozza e presente, nessun rischio: la barra sta a meta altezza */
@media (max-width:520px){
  .fg-textbar{ right:8px!important; padding:6px 4px!important; gap:6px!important }
  .fg-textbar button, .fg-textbar #stkTrig{ width:36px!important; height:36px!important; font-size:1rem!important }
  .fg-bgpal{ right:52px!important }
  .fg-bgpal i{ width:26px;height:26px }
}

/* POSTTEXT-V1: pannello testo post identico alle storie */
#postTextTools{
  position:fixed!important; bottom:0!important; left:0!important; right:0!important;
  top:auto!important; margin:0!important; z-index:9999!important;
  padding:12px 14px 20px!important;
  background:rgba(15,15,15,.97)!important;
  backdrop-filter:blur(20px)!important; -webkit-backdrop-filter:blur(20px)!important;
  border:none!important; border-top:1px solid rgba(255,255,255,.12)!important;
  border-radius:18px 18px 0 0!important;
  box-shadow:0 -8px 30px rgba(0,0,0,.5)!important;
  max-height:70vh; overflow-y:auto;
}
#postTextTools .st-text-input{
  background:rgba(255,255,255,.1)!important; color:#fff!important;
  border:1px solid rgba(255,255,255,.2)!important; font-size:1rem!important;
}
#postTextTools .st-text-input::placeholder{ color:rgba(255,255,255,.5)!important }
#postTextTools .st-size-label{ color:#fff!important }
#postTextTools .st-fonts-row button{ color:#fff!important; background:rgba(255,255,255,.12)!important; border-color:rgba(255,255,255,.2)!important }
#postTextTools .st-fonts-row button.active{ background:#fff!important; color:#111!important }
/* nel post niente sticker nella barra: solo Aa e A */
#previewContainer .fg-textbar #stkTrig, .fg-textbar.fg-nostk #stkTrig{ display:none!important }

/* TEXTBAR-V6: via i bottoni doppi, resta solo la barra */
/* il vecchio Aa vive SOLO dentro la barra: fuori sparisce */
.st-text-btn:not(.fg-moved):not(.fg-textbar *){ display:none!important }
.fg-textbar .st-text-btn{ display:flex!important }
/* stessa cosa per lo sticker: solo dentro la barra */
#stkTrig:not(.fg-textbar *){ display:none!important }
.fg-textbar #stkTrig{ display:flex!important }

/* CLOSE-TEXT-X */
.fg-close-x{position:absolute;left:10px;top:10px;z-index:14;width:38px;height:38px;border-radius:50%;
  border:none;background:rgba(255,255,255,.16);color:#fff;font-size:1.1rem;cursor:pointer;
  display:flex;align-items:center;justify-content:center;backdrop-filter:blur(6px)}
.fg-close-x:active{transform:scale(.92)}

/* ONE-X-POST */ #postTextTools .fg-close-x{ display:none !important }
