/* ==========================================================================
   FG-COMMUNITY-PRO — vestito nuovo della community (telefono · tablet · desktop)
   Si appoggia sopra community-main.css senza toccare la logica della pagina.
   Palette: quella di Milella's Kitchen (terracotta/crema) sui token gia' esistenti.
   ========================================================================== */
:root{
  --fgc-accent:#d4705f; --fgc-accent-2:#b55a4a; --fgc-soft:#fbf3ef; --fgc-ink:#2b2420;
  --fgc-r:18px; --fgc-r-s:12px; --fgc-shadow:0 1px 2px rgba(43,36,32,.06),0 8px 24px -12px rgba(43,36,32,.18);
  --fgc-rail:248px; --fgc-side:320px; --fgc-feed:470px; --fgc-bottom:64px;
  --fgc-bg2:#f3eee9;
}
body.dark{ --fgc-soft:#1c1816; --fgc-bg2:#1a1715; --fgc-shadow:0 1px 2px rgba(0,0,0,.4),0 8px 24px -12px rgba(0,0,0,.6); --fgc-ink:#f3eee9; }
html.fgc body{ background:var(--bg); }
html.fgc{ --bg:#f6f2ee; }
html.fgc body.dark{ --bg:#0e0d0c; --card:#161412; --border:#2a2624; }

/* ---------- header (telefono) ---------- */
html.fgc .header{ background:var(--card); color:var(--text); border-bottom:1px solid var(--border); box-shadow:none; padding:8px 12px; min-height:56px; }
html.fgc .header h1{ font-family:'Pacifico','Playfair Display',serif; font-weight:400; font-size:1.45rem; letter-spacing:.2px; color:var(--fgc-accent); line-height:1; margin:0; }
html.fgc .header-right{ display:flex; align-items:center; gap:6px; }
html.fgc .header-btn{ background:var(--fgc-soft); color:var(--text); width:40px; height:40px; border-radius:14px; font-size:1.05rem; box-shadow:none; }
html.fgc .header-btn:active{ transform:scale(.94); }
html.fgc .badge{ background:var(--fgc-accent); border:2px solid var(--card); top:-4px; right:-4px; min-width:18px; height:18px; }
html.fgc .dark-toggle span{ display:none; }
html.fgc .dark-toggle label{ background:var(--fgc-bg2); border:1px solid var(--border); }
html.fgc .dark-toggle input:checked+label{ background:var(--fgc-accent); }

/* ---------- storie ---------- */
html.fgc .stories-bar{ background:var(--card); border-bottom:0; padding:14px 0 10px; }
html.fgc .stories-inner{ padding:0 12px; gap:14px; }
html.fgc .story-item{ min-width:70px; gap:6px; }
html.fgc .story-avatar-wrap{ width:66px; height:66px; padding:2.5px; background:linear-gradient(135deg,#f9a66c,#d4705f 45%,#b03a6b); transition:transform .15s; }
html.fgc .story-item:active .story-avatar-wrap{ transform:scale(.94); }
html.fgc .story-avatar-wrap.viewed{ background:var(--border); }
html.fgc .story-avatar-wrap.add{ background:var(--fgc-bg2); border:1.5px dashed var(--fgc-accent); padding:3px; }
html.fgc .story-add-icon{ background:var(--fgc-accent); color:#fff; border:2px solid var(--card); width:22px; height:22px; font-weight:700; border-radius:50%; display:flex; align-items:center; justify-content:center; position:absolute; right:-2px; bottom:-2px; font-size:16px; line-height:1; }
html.fgc .story-name{ font-size:.72rem; color:var(--text); max-width:70px; overflow:hidden; text-overflow:ellipsis; }

/* ---------- barra (tab + crea): telefono in basso, tablet/desktop a sinistra ---------- */
html.fgc #fgcRail{ position:fixed; left:0; right:0; bottom:0; z-index:95; background:var(--card); border-top:1px solid var(--border); padding:6px 8px calc(6px + env(safe-area-inset-bottom,0px)); display:flex; align-items:center; }
html.fgc #fgcRail .fgc-brand, html.fgc #fgcRail .fgc-acct, html.fgc #fgcRail .fgc-foot{ display:none; }
html.fgc .tabs{ position:static; display:flex; background:transparent; border:0; flex:1; gap:2px; }
html.fgc .tab{ flex:1; padding:6px 1px 4px; font-size:.6rem; letter-spacing:-.1px; white-space:nowrap; overflow:hidden; font-weight:600; color:var(--text2); border-radius:14px; display:flex; flex-direction:column; align-items:center; gap:3px; line-height:1; min-height:52px; justify-content:center; }
html.fgc .tab::before{ content:''; width:22px; height:22px; background:currentColor; -webkit-mask:var(--fgc-i) center/contain no-repeat; mask:var(--fgc-i) center/contain no-repeat; }
html.fgc .tab.active{ color:var(--fgc-accent); background:var(--fgc-soft); }
html.fgc .tab.active::after{ display:none; }
html.fgc .tab[data-type="for_you"]{ --fgc-i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 11.5 12 4l9 7.5V20a1 1 0 0 1-1 1h-5v-6H9v6H4a1 1 0 0 1-1-1z'/%3E%3C/svg%3E"); }
html.fgc .tab[data-type="following"]{ --fgc-i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='8' r='4'/%3E%3Cpath d='M2 21a7 7 0 0 1 14 0'/%3E%3Ccircle cx='17' cy='9' r='3'/%3E%3Cpath d='M22 20a5 5 0 0 0-6-4.9'/%3E%3C/svg%3E"); }
html.fgc .tab[data-type="reels"]{ --fgc-i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='4'/%3E%3Cpath d='M3 9h18M8 3l3 6M14 3l3 6'/%3E%3Cpath d='M10 13.5v5l4.5-2.5z' fill='black'/%3E%3C/svg%3E"); }
html.fgc .tab[data-type="explore"]{ --fgc-i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E"); }
html.fgc .fgc-extra{ display:contents; }
html.fgc .tab.fgc-link{ text-decoration:none; }
html.fgc .tab[data-type="link-ar"]{ --fgc-i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3 3 7.5v9L12 21l9-4.5v-9z'/%3E%3Cpath d='M3 7.5 12 12l9-4.5M12 12v9'/%3E%3C/svg%3E"); }
html.fgc .tab[data-type="link-editor"]{ --fgc-i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='3'/%3E%3Cpath d='M3 10h18M7 5v14M17 5v14'/%3E%3C/svg%3E"); }
html.fgc .fgc-create{ position:fixed; right:16px; bottom:calc(var(--fgc-bottom) + 14px + env(safe-area-inset-bottom,0px)); z-index:96; width:56px; height:56px; border:0; border-radius:18px; background:linear-gradient(135deg,var(--fgc-accent),var(--fgc-accent-2)); color:#fff; box-shadow:0 6px 16px -6px rgba(212,112,95,.8); cursor:pointer; display:flex; align-items:center; justify-content:center; order:3; }
html.fgc .fgc-create::before{ content:''; width:26px; height:26px; background:#fff; -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E") center/contain no-repeat; mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E") center/contain no-repeat; }
html.fgc .fgc-create:active{ transform:scale(.94); }
html.fgc .tabs{ display:contents; }
html.fgc body{ padding-bottom:calc(var(--fgc-bottom) + env(safe-area-inset-bottom,0px)); }

/* ---------- foglio "Crea" ---------- */
html.fgc #fgcSheet{ position:fixed; inset:0; z-index:1200; display:none; align-items:flex-end; justify-content:center; background:rgba(20,14,12,.45); -webkit-backdrop-filter:blur(3px); backdrop-filter:blur(3px); }
html.fgc #fgcSheet.open{ display:flex; }
html.fgc #fgcSheet .fgc-sh{ width:100%; max-width:520px; background:var(--card); border-radius:24px 24px 0 0; padding:10px 16px calc(20px + env(safe-area-inset-bottom,0px)); box-shadow:0 -10px 40px rgba(0,0,0,.25); animation:fgcUp .22s cubic-bezier(.2,.9,.3,1.2); }
@keyframes fgcUp{ from{ transform:translateY(40px); opacity:0 } to{ transform:none; opacity:1 } }
html.fgc #fgcSheet .fgc-grip{ width:40px; height:4px; border-radius:2px; background:var(--border); margin:0 auto 14px; }
html.fgc #fgcSheet h3{ margin:0 0 12px; font-size:1.05rem; color:var(--text); }
html.fgc #fgcSheet .fgc-opts{ display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
html.fgc #fgcSheet button{ border:1px solid var(--border); background:var(--fgc-soft); color:var(--text); border-radius:16px; padding:16px 8px 12px; font:inherit; font-weight:600; font-size:.85rem; cursor:pointer; display:flex; flex-direction:column; align-items:center; gap:8px; }
html.fgc #fgcSheet button span{ font-size:1.7rem; line-height:1; }
html.fgc #fgcSheet button:active{ transform:scale(.96); }

/* colonna destra: solo su desktop */
html.fgc #fgcSide{ display:none; }

/* ---------- post come card ---------- */
html.fgc .feed{ max-width:var(--fgc-feed); padding:8px 0 0; }
html.fgc .post{ border:0; border-radius:var(--fgc-r); margin:0 8px 14px; overflow:hidden; box-shadow:var(--fgc-shadow); background:var(--card); }
html.fgc .post-head{ padding:12px 14px; }
html.fgc .post-head .avatar{ width:40px; height:40px; }
html.fgc .post-head .avatar.fgc-story{ box-shadow:0 0 0 2px var(--card),0 0 0 4.5px var(--fgc-accent); }
html.fgc .post-head .avatar.fgc-story-vista{ box-shadow:0 0 0 2px var(--card),0 0 0 4px var(--border); }
html.fgc .username{ font-size:.9rem; }
html.fgc .post-head > .act-btn{ background:var(--fgc-soft)!important; color:var(--fgc-accent)!important; border-radius:999px; padding:6px 12px!important; font-size:.78rem!important; }
html.fgc .post-menu-btn{ background:transparent; border:0; font-size:1.2rem; color:var(--text2); width:34px; height:34px; border-radius:50%; }
html.fgc .post-menu-btn:hover{ background:var(--fgc-soft); }
html.fgc .media-wrap{ background:var(--fgc-bg2); }
html.fgc .carousel-dots{ gap:5px; }
html.fgc .carousel-dot{ width:6px; height:6px; background:rgba(255,255,255,.55); }
html.fgc .carousel-dot.active{ background:#fff; width:16px; border-radius:3px; }
html.fgc .carousel-nav{ background:rgba(255,255,255,.9); color:#222; width:30px; height:30px; border-radius:50%; font-size:20px; line-height:1; border:0; box-shadow:0 2px 8px rgba(0,0,0,.25); }
html.fgc .flag{ background:rgba(0,0,0,.35); border-radius:999px; padding:2px 6px; font-size:.9rem; }

/* azioni: icone vere, i testi emoji restano per il codice ma spariscono alla vista */
html.fgc .actions{ padding:8px 10px 2px; gap:0; flex-wrap:nowrap; }
html.fgc .actions .act-btn{ font-size:0!important; color:transparent; width:40px; height:40px; border-radius:12px; display:inline-flex; align-items:center; justify-content:center; padding:0; position:relative; flex:0 0 auto; }
html.fgc .actions .act-btn::before{ content:''; width:24px; height:24px; background:var(--text); -webkit-mask:var(--fgc-i) center/contain no-repeat; mask:var(--fgc-i) center/contain no-repeat; transition:transform .15s; }
html.fgc .actions .act-btn:active::before{ transform:scale(.85); }
html.fgc .actions .act-btn:hover{ background:var(--fgc-soft); }
html.fgc .actions .act-count{ font-size:.82rem; font-weight:600; color:var(--text); margin:0 10px 0 -2px; min-width:14px; }
html.fgc .actions .act-count:empty{ margin-right:4px; }
html.fgc .actions .act-btn:nth-of-type(1){ --fgc-i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M12 20.5s-7.5-4.6-9.3-9.2C1.4 8 3.6 4.5 7.3 4.5c2 0 3.5 1.1 4.7 2.6 1.2-1.5 2.7-2.6 4.7-2.6 3.7 0 5.9 3.5 4.6 6.8C19.5 15.9 12 20.5 12 20.5z'/%3E%3C/svg%3E"); }
html.fgc .actions .act-btn.liked{ --fgc-i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M12 20.5s-7.5-4.6-9.3-9.2C1.4 8 3.6 4.5 7.3 4.5c2 0 3.5 1.1 4.7 2.6 1.2-1.5 2.7-2.6 4.7-2.6 3.7 0 5.9 3.5 4.6 6.8C19.5 15.9 12 20.5 12 20.5z'/%3E%3C/svg%3E"); }
html.fgc .actions .act-btn.liked::before{ background:var(--like); animation:fgcPop .3s; }
@keyframes fgcPop{ 0%{transform:scale(.6)} 60%{transform:scale(1.25)} 100%{transform:scale(1)} }
html.fgc .actions .act-btn:nth-of-type(2){ --fgc-i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M21 12a8 8 0 0 1-11.6 7.1L4 21l1.6-4.7A8 8 0 1 1 21 12z'/%3E%3C/svg%3E"); }
html.fgc .actions .act-btn:nth-of-type(3){ --fgc-i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round' stroke-linecap='round'%3E%3Cpath d='M21 3 10.5 13.5M21 3l-6.5 18-4-7.5L3 9.5z'/%3E%3C/svg%3E"); }
html.fgc .actions .act-btn:nth-of-type(4){ --fgc-i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round' stroke-linecap='round'%3E%3Cpath d='M17 2l4 4-4 4'/%3E%3Cpath d='M3 11V9a4 4 0 0 1 4-4h14'/%3E%3Cpath d='M7 22l-4-4 4-4'/%3E%3Cpath d='M21 13v2a4 4 0 0 1-4 4H3'/%3E%3C/svg%3E"); }
html.fgc .actions .act-btn.save-btn{ margin-left:auto; --fgc-i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M6 3h12a1 1 0 0 1 1 1v17l-7-4.5L5 21V4a1 1 0 0 1 1-1z'/%3E%3C/svg%3E"); }
html.fgc .actions .act-btn.save-btn.saved{ --fgc-i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M6 3h12a1 1 0 0 1 1 1v17l-7-4.5L5 21V4a1 1 0 0 1 1-1z'/%3E%3C/svg%3E"); }
html.fgc .actions .act-btn.save-btn.saved::before{ background:var(--fgc-accent); }
html.fgc .content{ padding:4px 14px 14px; }
html.fgc .likes{ font-weight:700; font-size:.85rem; }
html.fgc .caption{ font-size:.92rem; line-height:1.45; }
html.fgc .caption b{ font-weight:700; }
html.fgc .view-comments{ color:var(--text2); font-size:.85rem; margin-top:4px; }
html.fgc .time{ font-size:.7rem; text-transform:uppercase; letter-spacing:.5px; color:var(--text2); margin-top:6px; }
html.fgc .c-tr{ color:var(--fgc-accent); font-size:.78rem; font-weight:600; }
html.fgc .comment-input-wrap{ padding:10px 14px; gap:8px; }
html.fgc .comment-input{ background:var(--fgc-bg2); border:1px solid transparent; border-radius:999px; padding:10px 14px; font-size:.9rem; flex:1; min-width:0; color:var(--text); }
html.fgc .comment-input:focus{ outline:none; border-color:var(--fgc-accent); background:var(--card); }
html.fgc .comment-send{ background:var(--fgc-accent); color:#fff; border:0; border-radius:999px; padding:9px 14px; font-weight:700; font-size:.85rem; }
html.fgc .comment-send:disabled{ opacity:.4; }
html.fgc .gif-btn{ border:1px solid var(--border); border-radius:8px; background:transparent; color:var(--text); font-size:.7rem; font-weight:700; padding:6px 7px; }
html.fgc .empty{ padding:50px 20px; }
html.fgc .empty-btn{ background:var(--fgc-accent); color:#fff; border-radius:999px; padding:12px 22px; font-weight:700; border:0; }

/* esplora */
html.fgc .exp-sb{ background:var(--bg); }
html.fgc .exp-cat{ background:var(--card); border:1px solid var(--border); border-radius:999px; }
html.fgc .exp-cat.ac,html.fgc .exp-cat.active{ background:var(--fgc-accent); color:#fff; border-color:var(--fgc-accent); }
html.fgc .exp-grid{ gap:3px; padding:3px; border-radius:var(--fgc-r-s); overflow:hidden; }

/* notifiche */
html.fgc .notif-panel{ border-radius:0 24px 24px 0; }
html.fgc .notif-item{ border-radius:14px; margin:4px 8px; }
html.fgc .notif-item.unread{ background:var(--fgc-soft); }

/* ---------- tablet: barra a sinistra solo icone ---------- */
@media (min-width:768px){
  html.fgc{ --fgc-rail:88px; --fgc-feed:540px; }
  html.fgc body{ padding-bottom:0; padding-left:var(--fgc-rail); }
  html.fgc .header{ display:none; }
  html.fgc #fgcRail{ top:0; bottom:0; right:auto; width:var(--fgc-rail); flex-direction:column; align-items:stretch; padding:14px 12px 16px; border-top:0; border-right:1px solid var(--border); background:var(--card); -webkit-backdrop-filter:none; backdrop-filter:none; gap:4px; overflow-y:auto; scrollbar-width:none; }
  html.fgc #fgcRail .fgc-brand{ display:flex; align-items:center; justify-content:center; height:52px; margin-bottom:10px; text-decoration:none; }
  html.fgc #fgcRail .fgc-brand b{ font-family:'Pacifico','Playfair Display',serif; font-weight:400; font-size:1.5rem; color:var(--fgc-accent); display:none; }
  html.fgc #fgcRail .fgc-brand i{ width:44px; height:44px; border-radius:14px; background:linear-gradient(135deg,var(--fgc-accent),var(--fgc-accent-2)); display:flex; align-items:center; justify-content:center; font-style:normal; font-size:1.4rem; }
  html.fgc .tabs{ display:contents; }
  html.fgc .tab,html.fgc #fgcRail .fgc-acct button,html.fgc #fgcRail .fgc-acct a{ order:0; flex:0 0 auto; display:flex; flex-direction:row; align-items:center; justify-content:center; gap:14px; min-height:0; height:48px; padding:0; border-radius:14px; font-size:.95rem; font-weight:600; color:var(--text); background:transparent; border:0; text-decoration:none; cursor:pointer; position:relative; font-family:inherit; }
  html.fgc .tab:hover,html.fgc #fgcRail .fgc-acct button:hover,html.fgc #fgcRail .fgc-acct a:hover{ background:var(--fgc-soft); }
  html.fgc .tab.active{ background:var(--fgc-soft); color:var(--fgc-accent); }
  html.fgc .tab.active::before,html.fgc .tab::before,html.fgc .fgc-acct a::before,html.fgc .fgc-acct button::before{ width:26px; height:26px; flex:0 0 26px; }
  html.fgc .tab span,html.fgc .fgc-acct span.t{ display:none; }
  html.fgc #fgcRail .fgc-create{ position:static; order:1; width:auto; height:48px; margin:8px 0; border-radius:14px; right:auto; bottom:auto; }
  html.fgc #fgcRail .fgc-acct{ display:flex; flex-direction:column; gap:4px; margin-top:auto; padding-top:10px; border-top:1px solid var(--border); order:2; }
  html.fgc #fgcRail .tab[data-type]{ order:0; }
  html.fgc #fgcRail .fgc-extra .tab{ order:0; }
  html.fgc .fgc-acct a::before,html.fgc .fgc-acct button::before{ content:''; background:currentColor; -webkit-mask:var(--fgc-i) center/contain no-repeat; mask:var(--fgc-i) center/contain no-repeat; }
  html.fgc .fgc-acct .fgc-b{ position:absolute; top:6px; left:calc(50% + 4px); background:var(--fgc-accent); color:#fff; font-size:.62rem; font-weight:700; min-width:17px; height:17px; border-radius:9px; display:none; align-items:center; justify-content:center; padding:0 4px; border:2px solid var(--card); }
  html.fgc .fgc-acct .fgc-b.on{ display:flex; }
  html.fgc .fgc-acct .fgc-av{ width:28px; height:28px; border-radius:50%; object-fit:cover; box-shadow:0 0 0 2px var(--fgc-accent); }
  html.fgc .stories-bar{ border-radius:var(--fgc-r); margin:12px auto 0; max-width:var(--fgc-feed); box-shadow:var(--fgc-shadow); }
  html.fgc .feed{ padding-top:12px; }
  html.fgc .post{ margin:0 0 16px; }
  html.fgc .suggested-section,html.fgc .search-section{ max-width:var(--fgc-feed); margin:12px auto 0; border-radius:var(--fgc-r); background:var(--card); }
  html.fgc .exp-wrap{ max-width:900px; margin:0 auto; }
}

/* ---------- desktop: barra con etichette + colonna destra ---------- */
@media (min-width:1100px){
  html.fgc{ --fgc-rail:248px; --fgc-feed:560px; }
  html.fgc #fgcRail{ padding:18px 16px 20px; }
  html.fgc #fgcRail .fgc-brand{ justify-content:flex-start; gap:12px; padding:0 8px; }
  html.fgc #fgcRail .fgc-brand b{ display:block; }
  html.fgc #fgcRail .fgc-brand i{ width:40px; height:40px; }
  html.fgc .tab,html.fgc #fgcRail .fgc-acct button,html.fgc #fgcRail .fgc-acct a{ justify-content:flex-start; padding:0 14px; }
  html.fgc .tab span,html.fgc .fgc-acct span.t{ display:inline; }
  html.fgc .fgc-create::after{ content:attr(data-label); font-weight:700; font-size:.95rem; margin-left:10px; }
  html.fgc #fgcRail .fgc-create{ position:static; }
  html.fgc .fgc-acct .fgc-b{ position:static; margin-left:auto; border:0; }
  html.fgc .fgc-main{ display:grid; grid-template-columns:var(--fgc-feed) var(--fgc-side); gap:32px; justify-content:center; align-items:start; padding:0 24px; }
  html.fgc .fgc-main > .fgc-col{ min-width:0; }
  html.fgc #fgcSide{ position:sticky; top:14px; display:flex; flex-direction:column; gap:14px; padding-top:12px; }
  html.fgc #fgcSide .fgc-card{ background:var(--card); border-radius:var(--fgc-r); box-shadow:var(--fgc-shadow); padding:16px; }
  html.fgc #fgcSide h4{ margin:0 0 10px; font-size:.78rem; text-transform:uppercase; letter-spacing:.8px; color:var(--text2); }
  html.fgc #fgcSide .fgc-me{ display:flex; align-items:center; gap:12px; }
  html.fgc #fgcSide .fgc-me img{ width:52px; height:52px; border-radius:50%; object-fit:cover; box-shadow:0 0 0 2px var(--card),0 0 0 4px var(--fgc-accent); }
  html.fgc #fgcSide .fgc-me b{ display:block; font-size:.95rem; }
  html.fgc #fgcSide .fgc-me small{ color:var(--text2); }
  html.fgc #fgcSide .fgc-me a{ margin-left:auto; color:var(--fgc-accent); font-weight:700; font-size:.82rem; text-decoration:none; }
  html.fgc #fgcSide .fgc-links{ display:grid; grid-template-columns:1fr 1fr; gap:8px; }
  html.fgc #fgcSide .fgc-links a{ display:flex; align-items:center; gap:10px; padding:10px 12px; border-radius:12px; background:var(--fgc-soft); color:var(--text); text-decoration:none; font-weight:600; font-size:.85rem; }
  html.fgc #fgcSide .fgc-links a:hover{ background:var(--fgc-bg2); }
  html.fgc #fgcSide .fgc-links a span{ font-size:1.2rem; }
  html.fgc #fgcSide .suggested-section{ margin:0; padding:0; border:0; box-shadow:none; }
  html.fgc #fgcSide .suggested-section .suggested-title{ display:none; }
  html.fgc #fgcSide .suggested-scroll{ flex-direction:column; overflow:visible; }
  html.fgc #fgcSide .fgc-foot{ display:block; font-size:.72rem; color:var(--text2); line-height:1.8; padding:0 6px; }
  html.fgc #fgcSide .fgc-foot a{ color:var(--text2); text-decoration:none; }
  html.fgc .stories-bar{ margin-top:12px; }
}
@media (prefers-reduced-motion:reduce){ html.fgc *{ animation:none!important; transition:none!important; } }

/* schede sconosciute (es. Mappa Live): icona della mappa invece del quadrato */
html.fgc .tab:not([data-type="for_you"]):not([data-type="following"]):not([data-type="reels"]):not([data-type="explore"]):not([data-type^="link-"]){ --fgc-i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21s-6-5.3-6-10a6 6 0 0 1 12 0c0 4.7-6 10-6 10z'/%3E%3Ccircle cx='12' cy='11' r='2.5'/%3E%3C/svg%3E"); }

/* prestazioni su telefono: ombre leggere, niente animazioni pesanti */
@media (max-width:767px){ html.fgc{ --fgc-shadow:0 1px 3px rgba(43,36,32,.08); } html.fgc .post{ contain:layout paint; } }

@media (max-width:767px){ .gamification-mobile-bar{ display:none!important; } }

/* ==========================================================================
   GAMIFICATION — una sola barra pulita (stile "I tuoi progressi" del telefono)
   via il joystick e tutto quello che apriva, il pannello laterale, la barra in basso, la card "giorni" doppia
   ========================================================================== */
.dopamine-fab-container, #dopamine-fab-overlay, .dopamine-fab-overlay, #micro-progress-widget, #gamificationBar, .gamification-mobile-bar, .dopamine-streak-indicator{ display:none!important; }
body.fab-open, body.dopamine-fab-open{ filter:none!important; overflow:auto!important; }
@media (min-width:769px){
  .dopamine-xp-bar{ background:var(--fgc-card,#fff)!important; border-bottom:1px solid var(--fgc-line,#e6ddd6)!important; box-shadow:0 6px 18px -14px rgba(43,36,32,.35)!important; padding:8px 20px!important; backdrop-filter:none!important; -webkit-backdrop-filter:none!important; font-family:Inter,-apple-system,BlinkMacSystemFont,system-ui,sans-serif!important; color:var(--fgc-text,#262626)!important; }
  .dopamine-xp-bar::before, .dopamine-xp-bar::after{ display:none!important; }
  .dopamine-xp-bar .xp-bar-container{ max-width:1100px!important; margin:0 auto!important; display:flex!important; align-items:center!important; gap:14px!important; background:none!important; padding:0!important; }
  .dopamine-xp-bar .xp-level-badge{ width:40px!important; height:40px!important; min-width:40px; border-radius:50%!important; background:linear-gradient(135deg,var(--fgc-accent,#d4705f),var(--fgc-accent-2,#b55a4a))!important; box-shadow:0 0 0 3px var(--fgc-soft,#fbf3ef)!important; border:0!important; animation:none!important; display:flex!important; align-items:center; justify-content:center; cursor:pointer; }
  .dopamine-xp-bar .xp-level-badge::before, .dopamine-xp-bar .xp-level-badge::after{ display:none!important; }
  .dopamine-xp-bar .level-number{ color:#fff!important; font:800 15px/1 Inter,system-ui,sans-serif!important; text-shadow:none!important; -webkit-text-fill-color:#fff!important; background:none!important; }
  .dopamine-xp-bar .xp-progress-track{ flex:1 1 auto!important; height:10px!important; border-radius:999px!important; background:var(--fgc-soft,#fbf3ef)!important; border:1px solid var(--fgc-line,#e6ddd6)!important; box-shadow:none!important; overflow:hidden; }
  .dopamine-xp-bar .xp-progress-fill{ background:linear-gradient(90deg,var(--fgc-accent,#d4705f),#e8a25f)!important; border-radius:999px!important; box-shadow:none!important; animation:none!important; }
  .dopamine-xp-bar .xp-progress-fill::after, .dopamine-xp-bar .xp-progress-glow{ display:none!important; }
  .dopamine-xp-bar .xp-info{ display:flex!important; flex-direction:column; line-height:1.15; min-width:110px; }
  .dopamine-xp-bar .xp-current{ color:var(--fgc-text,#262626)!important; font-weight:800!important; font-size:.88rem!important; text-shadow:none!important; }
  .dopamine-xp-bar .xp-needed{ color:var(--fgc-text2,#8e8e8e)!important; font-size:.72rem!important; opacity:1!important; }
  .dopamine-xp-bar .coins-display{ display:inline-flex!important; align-items:center!important; gap:6px!important; height:36px; padding:0 14px!important; border-radius:999px!important; background:var(--fgc-soft,#fbf3ef)!important; border:1px solid var(--fgc-line,#e6ddd6)!important; box-shadow:none!important; color:var(--fgc-text,#262626)!important; margin:0!important; cursor:pointer; transition:transform .15s ease; }
  .dopamine-xp-bar .coins-display:hover{ transform:translateY(-1px); }
  .dopamine-xp-bar .coins-display .coin-icon{ font-size:0!important; width:18px; height:18px; display:inline-block; background:var(--fgc-accent,#d4705f); -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M14.5 9.5c-.5-1-1.5-1.5-2.5-1.5-1.7 0-2.8 1-2.8 2.2 0 2.8 5.6 1.6 5.6 4.4 0 1.2-1.2 2.2-2.8 2.2-1.1 0-2.1-.5-2.6-1.5M12 6.5V8M12 16.5V18'/%3E%3C/svg%3E") center/contain no-repeat; mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M14.5 9.5c-.5-1-1.5-1.5-2.5-1.5-1.7 0-2.8 1-2.8 2.2 0 2.8 5.6 1.6 5.6 4.4 0 1.2-1.2 2.2-2.8 2.2-1.1 0-2.1-.5-2.6-1.5M12 6.5V8M12 16.5V18'/%3E%3C/svg%3E") center/contain no-repeat; animation:none!important; }
  .dopamine-xp-bar .fg-chip-streak .coin-icon{ -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22c4 0 7-2.7 7-6.8 0-3.6-2.6-6.2-4.4-8.4-.4 2-1.4 3.4-2.9 4.1.3-3.2-1.2-6.4-3.7-8.4.2 3.4-2.9 5.8-3.7 8.3C3.6 15.4 6.3 22 12 22z'/%3E%3C/svg%3E"); mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22c4 0 7-2.7 7-6.8 0-3.6-2.6-6.2-4.4-8.4-.4 2-1.4 3.4-2.9 4.1.3-3.2-1.2-6.4-3.7-8.4.2 3.4-2.9 5.8-3.7 8.3C3.6 15.4 6.3 22 12 22z'/%3E%3C/svg%3E"); }
  .dopamine-xp-bar .coins-amount{ color:var(--fgc-text,#262626)!important; font:800 .88rem/1 Inter,system-ui,sans-serif!important; text-shadow:none!important; -webkit-text-fill-color:currentColor!important; }
  .dopamine-xp-bar .rewards-btn{ display:inline-flex!important; align-items:center; gap:8px; height:36px; padding:0 18px!important; border:0!important; border-radius:999px!important; background:linear-gradient(135deg,var(--fgc-accent,#d4705f),var(--fgc-accent-2,#b55a4a))!important; color:#fff!important; font:700 .88rem/1 Inter,system-ui,sans-serif!important; box-shadow:0 6px 14px -8px rgba(212,112,95,.9)!important; animation:none!important; cursor:pointer; }
  .dopamine-xp-bar .rewards-btn::before{ content:''; width:16px; height:16px; background:#fff; -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 7h12l1 14H5L6 7z'/%3E%3Cpath d='M9 10V6a3 3 0 0 1 6 0v4'/%3E%3C/svg%3E") center/contain no-repeat; mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 7h12l1 14H5L6 7z'/%3E%3Cpath d='M9 10V6a3 3 0 0 1 6 0v4'/%3E%3C/svg%3E") center/contain no-repeat; }
}

/* ==========================================================================
   CREA POST / STORIA sul telefono: a tutto schermo come Instagram
   barra in alto fissa (chiudi a sinistra, titolo al centro), contenuto che scorre,
   bottone Pubblica sempre a portata di pollice in basso
   ========================================================================== */
@media (max-width:1023px){
  #postModal.show, #storyModal.show{ align-items:stretch!important; justify-content:stretch!important; padding:0!important; background:var(--fgc-card,#fff)!important; -webkit-backdrop-filter:none!important; backdrop-filter:none!important; }
  #postModal .modal, #storyModal .modal{ width:100vw!important; max-width:100vw!important; height:100vh!important; height:100dvh!important; max-height:none!important; margin:0!important; border-radius:0!important; display:flex!important; flex-direction:column!important; box-shadow:none!important; background:var(--fgc-card,#fff)!important; animation:fgcSu .26s cubic-bezier(.2,.9,.25,1)!important; overflow:hidden!important; }
  @keyframes fgcSu{ from{ transform:translateY(24px); opacity:.4 } to{ transform:none; opacity:1 } }
  #postModal .modal-head, #storyModal .modal-head{ position:relative!important; flex:0 0 auto; display:flex!important; align-items:center!important; justify-content:center!important; min-height:52px; padding:calc(env(safe-area-inset-top,0px) + 6px) 56px 6px!important; border-bottom:1px solid var(--fgc-line,#e6ddd6)!important; background:var(--fgc-card,#fff)!important; }
  #postModal .modal-head h2, #storyModal .modal-head h2{ font:700 1.02rem/1.2 Inter,system-ui,sans-serif!important; margin:0!important; text-align:center; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  #postModal .modal-close, #storyModal .modal-close{ position:absolute!important; left:8px!important; right:auto!important; top:calc(env(safe-area-inset-top,0px) + 6px)!important; width:40px!important; height:40px!important; border-radius:50%!important; font-size:1.9rem!important; line-height:1!important; background:transparent!important; color:var(--fgc-text,#262626)!important; display:flex!important; align-items:center; justify-content:center; }
  #postModal .modal-body, #storyModal .modal-body{ flex:1 1 auto!important; overflow-y:auto!important; -webkit-overflow-scrolling:touch; overscroll-behavior:contain; max-height:none!important; padding:0 14px calc(92px + env(safe-area-inset-bottom,0px))!important; }
  /* scegli foto: niente macchina fotografica gigante, una riga compatta come Instagram */
  #postModal .upload-zone, #storyModal .upload-zone{ margin:14px 0!important; border:1.5px dashed var(--fgc-line,#e6ddd6)!important; border-radius:18px!important; min-height:0!important; height:auto!important; aspect-ratio:auto!important; padding:16px!important; background:var(--fgc-soft,#fbf3ef)!important; display:flex!important; flex-direction:row!important; align-items:center; justify-content:flex-start; gap:14px; text-align:left; }
  #postModal .upload-zone-icon, #storyModal .upload-zone-icon{ display:none!important; }
  #postModal .upload-zone::before, #storyModal .upload-zone::before{ content:''; flex:0 0 48px; width:48px; height:48px; border-radius:14px; background:linear-gradient(135deg,var(--fgc-accent,#d4705f),var(--fgc-accent-2,#b55a4a)); -webkit-mask:none; box-shadow:0 8px 16px -10px rgba(212,112,95,.9); }
  #postModal .upload-zone::after, #storyModal .upload-zone::after{ content:''; position:absolute; left:28px; top:50%; transform:translateY(-50%); width:24px; height:24px; background:#fff; -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E") center/contain no-repeat; mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E") center/contain no-repeat; }
  #postModal .upload-zone, #storyModal .upload-zone{ position:relative; }
  #postModal .upload-zone p, #storyModal .upload-zone p{ margin:0!important; font:600 .98rem/1.3 Inter,system-ui,sans-serif!important; color:var(--fgc-text,#262626)!important; }
  #postModal .upload-zone:active, #storyModal .upload-zone:active{ transform:scale(.98); }
  #postModal #previewContainer, #storyModal #storyPreviewWrap{ margin:0 -14px!important; }
  #postModal #previewContainer img:not([class*="overlay-el"]), #postModal #previewContainer video{ border-radius:0!important; width:100%!important; }
  /* didascalia comoda */
  #postModal .caption-input, #storyModal textarea{ font-size:16px!important; border-radius:14px!important; }
  /* Pubblica sempre in basso */
  #postModal #pubBtn, #storyModal .pub-btn{ position:fixed!important; left:14px!important; right:14px!important; bottom:calc(12px + env(safe-area-inset-bottom,0px))!important; width:auto!important; z-index:30!important; margin:0!important; height:52px; border-radius:16px!important; font:700 1rem/1 Inter,system-ui,sans-serif!important; background:linear-gradient(135deg,var(--fgc-accent,#d4705f),var(--fgc-accent-2,#b55a4a))!important; color:#fff!important; box-shadow:0 10px 24px -10px rgba(212,112,95,.9)!important; opacity:1; }
  #postModal #pubBtn:disabled, #storyModal .pub-btn:disabled{ background:var(--fgc-line,#e6ddd6)!important; color:var(--fgc-text2,#8e8e8e)!important; box-shadow:none!important; }
  #postModal .modal-body::after, #storyModal .modal-body::after{ content:''; position:fixed; left:0; right:0; bottom:0; height:calc(84px + env(safe-area-inset-bottom,0px)); background:linear-gradient(to top,var(--fgc-card,#fff) 70%,transparent); pointer-events:none; z-index:29; }
  /* la pagina sotto non scorre mentre crei */
  body:has(#postModal.show), body:has(#storyModal.show){ overflow:hidden!important; }
  /* le barre di sotto non si vedono mentre crei */
  body:has(#postModal.show) #fgcRail, body:has(#storyModal.show) #fgcRail, body:has(#postModal.show) .fgc-create, body:has(#storyModal.show) .fgc-create, body:has(#postModal.show) #fgcHub, body:has(#storyModal.show) #fgcHub{ display:none!important; }
}
/* la barra Aa / A compare solo quando c'è davvero una foto o un video (prima galleggiava sopra la bozza e la didascalia) */
#previewContainer:not(:has(img,video,canvas)) .fg-textbar{ display:none!important; }
#storyPreviewWrap:not(:has(#storyPreview img,#storyPreview video,#storyPreview canvas)) .fg-textbar,
#storyPreviewWrap:not(:has(#storyPreview img,#storyPreview video,#storyPreview canvas)) > .st-text-btn{ display:none!important; }

/* tocchi immediati nei pannelli Crea (niente ritardo, niente lampo grigio) */
#postModal button, #storyModal button, #postModal .upload-zone, #storyModal .upload-zone, #postModal a, #storyModal a{ touch-action:manipulation; -webkit-tap-highlight-color:transparent; }
@media (max-width:1023px){
  /* opzioni del post come righe di Instagram: stessa larghezza, stesso stile */
  #postModal #locBtn, #postModal #schedToggle, #postModal #postPollToggle{ width:100%!important; display:flex!important; align-items:center; justify-content:flex-start!important; gap:10px; min-height:50px; padding:12px 16px!important; margin:0 0 8px!important; border-radius:14px!important; background:var(--fgc-soft,#fbf3ef)!important; border:1px solid var(--fgc-line,#e6ddd6)!important; color:var(--fgc-text,#262626)!important; font:600 .95rem/1.2 Inter,system-ui,sans-serif!important; text-align:left; }
  #postModal .modal-body > div:has(> #locBtn){ display:block!important; margin:0!important; }
  #postModal #schedWrap, #postModal #postPollWrap{ margin-top:0!important; }
  #storyModal #cfStoryToggle{ min-height:44px; padding:10px 18px!important; font-size:.92rem!important; }
}

/* ==========================================================================
   STORIA: quando c'e' la foto/il video, editor a tutto schermo scuro come Instagram
   anteprima grande da bordo a bordo, strumenti sopra l'anteprima, tutto il resto sotto in scuro
   ========================================================================== */
@media (max-width:1023px){
  #storyModal .fgd6-banner, #postModal .fgd6-banner{ margin:8px 14px 0!important; }
  #storyModal:has(#storyPreview img, #storyPreview video) .fgd6-banner,
  #postModal:has(#previewContainer img, #previewContainer video) .fgd6-banner{ display:none!important; }
  #storyModal:has(#storyPreview img, #storyPreview video) .upload-zone,
  #postModal:has(#previewContainer img, #previewContainer video) .upload-zone{ display:none!important; }

  #storyModal.show:has(#storyPreview img, #storyPreview video),
  #storyModal:has(#storyPreview img, #storyPreview video) .modal,
  #storyModal:has(#storyPreview img, #storyPreview video) .modal-head,
  #storyModal:has(#storyPreview img, #storyPreview video) .modal-body{ background:#0b0b0c!important; color:#f3eee9!important; border-color:rgba(255,255,255,.08)!important; }
  #storyModal:has(#storyPreview img, #storyPreview video) .modal-head h2,
  #storyModal:has(#storyPreview img, #storyPreview video) .modal-close{ color:#fff!important; }
  #storyModal:has(#storyPreview img, #storyPreview video) .modal-body{ padding-top:0!important; }
  #storyModal:has(#storyPreview img, #storyPreview video) #storyPreviewWrap{ margin:0 -14px 10px!important; }
  #storyModal:has(#storyPreview img, #storyPreview video) .modal-body::after{ background:linear-gradient(to top,#0b0b0c 70%,transparent)!important; }
  /* gli strumenti sotto, in scuro e compatti */
  #storyModal:has(#storyPreview img, #storyPreview video) label{ color:#cfc7c0!important; }
  #storyModal:has(#storyPreview img, #storyPreview video) textarea{ background:#1a1817!important; color:#fff!important; border:1px solid rgba(255,255,255,.12)!important; }
  #storyModal:has(#storyPreview img, #storyPreview video) textarea::placeholder{ color:#8f8780!important; }
  #storyModal:has(#storyPreview img, #storyPreview video) .fg-grid-btn,
  #storyModal:has(#storyPreview img, #storyPreview video) .story-layout-bar button,
  #storyModal:has(#storyPreview img, #storyPreview video) .sub-toggle{ background:#1a1817!important; color:#f3eee9!important; border-color:rgba(255,255,255,.14)!important; }
  #storyModal:has(#storyPreview img, #storyPreview video) .story-layout-bar{ background:transparent!important; }
  #storyModal:has(#storyPreview img, #storyPreview video) .sub-toggle *{ color:#f3eee9!important; }
  #storyModal:has(#storyPreview img, #storyPreview video) .filters-row{ padding:2px 0 6px!important; gap:8px!important; }
  #storyModal:has(#storyPreview img, #storyPreview video) .filters-row *{ color:#e9e3dd!important; }
  /* i bottoni grandi colorati (foto sopra, ritaglia, sottotitoli) diventano pillole scure */
  #storyModal:has(#storyPreview img, #storyPreview video) .modal-body > button:not(.pub-btn):not(.fg-grid-btn),
  #storyModal:has(#storyPreview img, #storyPreview video) #storyPreviewWrap ~ div > button:not(.pub-btn){ background:#1a1817!important; color:#f3eee9!important; border:1px solid rgba(255,255,255,.14)!important; box-shadow:none!important; border-radius:999px!important; min-height:40px; padding:8px 16px!important; font:600 .88rem/1.1 Inter,system-ui,sans-serif!important; }
  /* gli strumenti dentro l'anteprima: cerchi vetro come Instagram */
  #storyModal .fg-textbar button, #storyModal #stkTrig{ background:rgba(0,0,0,.58)!important; color:#fff!important; border:1px solid rgba(255,255,255,.22)!important; -webkit-backdrop-filter:none!important; backdrop-filter:none!important; box-shadow:0 4px 14px rgba(0,0,0,.25)!important; }
}
@media (max-width:1023px){
  #storyModal .fgd-ovbtn, #postModal .fgd-ovbtn{ background:rgba(255,255,255,.1)!important; color:#f3eee9!important; border:1px solid rgba(255,255,255,.2)!important; padding:9px 16px!important; font-size:.85rem!important; border-radius:999px!important; }
  #postModal .fgd-ovbtn{ background:var(--fgc-soft,#fbf3ef)!important; color:var(--fgc-text,#262626)!important; border-color:var(--fgc-line,#e6ddd6)!important; }
}

/* ==========================================================================
   EDITOR CREA — rifinitura finale
   ========================================================================== */
/* l'anteprima non taglia piu' gli strumenti (la barra del disegno perdeva i tasti in fondo) */
#storyModal #storyPreviewWrap{ overflow:visible!important; }

/* 1) TESTO come Instagram: scrivi SOPRA l'anteprima, al centro, a schermo intero */
#stTextTools.show, #postTextTools[style*="flex"], #postTextTools[style*="block"]{
  position:fixed!important; inset:0!important; z-index:3000!important; margin:0!important; border:0!important; border-radius:0!important;
  background:rgba(10,10,12,.62)!important; -webkit-backdrop-filter:blur(6px); backdrop-filter:blur(6px);
  display:flex!important; flex-direction:column!important; justify-content:flex-start!important; gap:12px!important;
  padding:calc(env(safe-area-inset-top,0px) + 64px) 16px 16px!important; box-shadow:none!important; overflow:auto; }
#stTextTools.show .st-input-row, #postTextTools .st-input-row{ order:3; display:block!important; background:none!important; border:0!important; padding:0!important; }
#stTextTools.show textarea, #postTextTools textarea#postTextInput{
  width:100%!important; min-height:130px; background:transparent!important; border:0!important; outline:none!important; box-shadow:none!important; resize:none!important;
  color:#fff!important; text-align:center!important; font:800 30px/1.25 Inter,system-ui,sans-serif!important; text-shadow:0 2px 12px rgba(0,0,0,.55)!important;
  caret-color:var(--fgc-accent,#d4705f); -webkit-user-select:text!important; user-select:text!important; padding:8px 0!important; }
#stTextTools.show textarea::placeholder, #postTextTools textarea::placeholder{ color:rgba(255,255,255,.55)!important; }
#stTextTools.show .st-colors-row, #postTextTools .st-colors-row{ order:1; display:flex!important; overflow-x:auto; gap:10px!important; padding:4px 2px!important; flex-wrap:nowrap!important; scrollbar-width:none; }
#stTextTools.show .st-fonts-row, #postTextTools .st-fonts-row{ order:2; display:flex!important; overflow-x:auto; gap:8px!important; flex-wrap:nowrap!important; scrollbar-width:none; }
#stTextTools.show .st-fonts-row > *, #postTextTools .st-fonts-row > *{ flex:0 0 auto; background:rgba(255,255,255,.14)!important; color:#fff!important; border:1px solid rgba(255,255,255,.22)!important; border-radius:999px!important; }
#stTextTools.show .st-size-row, #postTextTools .st-size-row{ order:4; display:flex!important; align-items:center; gap:10px; background:none!important; }
#stTextTools.show .st-size-label, #postTextTools .st-size-label{ color:#fff!important; }
#stTextTools.show .fgc-fatto, #postTextTools .fgc-fatto{
  position:fixed!important; top:calc(env(safe-area-inset-top,0px) + 12px)!important; right:14px!important; z-index:3001!important; width:auto!important; height:44px!important; min-width:44px;
  padding:0 20px!important; border:0!important; border-radius:999px!important; font-size:0!important; color:#fff!important;
  background:linear-gradient(135deg,var(--fgc-accent,#d4705f),var(--fgc-accent-2,#b55a4a))!important; box-shadow:0 8px 18px -8px rgba(212,112,95,.9)!important; display:flex!important; align-items:center; justify-content:center; }
#stTextTools.show .fgc-fatto::after, #postTextTools .fgc-fatto::after{ content:''; width:22px; height:22px; background:#fff; -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center/contain no-repeat; mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center/contain no-repeat; }
#stTextTools .fg-close-x, #postTextTools .fg-close-x{ display:none!important; }

/* 2) STICKER: i campi si toccano e si scrive (prima il foglio stava dentro l'anteprima "intoccabile") */
.stk-ov input, .stk-ov textarea, .stk-ov select{ -webkit-user-select:text!important; user-select:text!important; touch-action:manipulation!important; pointer-events:auto!important; font-size:16px!important; }
.stk-ov .stk-fi{ width:100%!important; max-width:100%!important; min-width:0!important; box-sizing:border-box!important; -webkit-appearance:none; appearance:none; }
.stk-ov .stk-fp{ overflow-x:hidden; }
.stk-ov .stk-ab{ background:linear-gradient(135deg,var(--fgc-accent,#d4705f),var(--fgc-accent-2,#b55a4a))!important; border-radius:999px!important; }

/* 3) DISEGNO: barra in alto, orizzontale, tutti i tasti sempre visibili (anche annulla e fatto) */
#storyModal .draw-tools-bar.active, .draw-tools-bar.active{
  position:fixed!important; top:calc(env(safe-area-inset-top,0px) + 60px)!important; left:10px!important; right:10px!important; bottom:auto!important;
  width:auto!important; height:54px!important; max-height:54px!important; flex-direction:row!important; flex-wrap:nowrap!important; align-items:center!important;
  overflow-x:auto!important; overflow-y:hidden!important; padding:6px 10px!important; gap:8px!important; border-radius:999px!important;
  background:rgba(0,0,0,.6)!important; -webkit-backdrop-filter:blur(10px); backdrop-filter:blur(10px); z-index:3000!important; scrollbar-width:none; }
.draw-tools-bar.active::-webkit-scrollbar{ display:none; }
.draw-tools-bar.active .dc{ flex:0 0 28px!important; width:28px!important; height:28px!important; }

/* 4) ELIMINARE: un solo modo per tutto — trascina sul cestino */
#storyModal .st-item-x, #postModal .st-item-x, #storyModal .stk-x, #postModal .stk-x{ display:none!important; }
#fgcTrash{ position:fixed; left:50%; bottom:calc(env(safe-area-inset-bottom,0px) + 96px); width:58px; height:58px; margin-left:-29px; border-radius:50%;
  background:rgba(0,0,0,.55); border:2px solid rgba(255,255,255,.75); z-index:3002; display:flex; align-items:center; justify-content:center;
  opacity:0; transform:translateY(16px) scale(.8); pointer-events:none; transition:opacity .16s ease, transform .16s ease, background .16s ease; }
#fgcTrash::before{ content:''; width:26px; height:26px; background:#fff; -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h16M9 7V4.5h6V7M6.5 7l1 13h9l1-13M10 11v6M14 11v6'/%3E%3C/svg%3E") center/contain no-repeat; mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h16M9 7V4.5h6V7M6.5 7l1 13h9l1-13M10 11v6M14 11v6'/%3E%3C/svg%3E") center/contain no-repeat; }
#fgcTrash.on{ opacity:1; transform:none; }
#fgcTrash.hot{ background:#e5484d; border-color:#fff; transform:scale(1.18); }
.fgc-trashing{ opacity:.45!important; transition:opacity .12s ease; }

/* 5) SOTTOTITOLI AI: scelta dello stile */
#fgSubStyle{ margin-top:10px; display:flex; flex-direction:column; gap:8px; }
#fgSubStyle .r{ display:flex; gap:8px; overflow-x:auto; scrollbar-width:none; }
#fgSubStyle .r::-webkit-scrollbar{ display:none; }
#fgSubStyle button{ flex:0 0 auto; border:1px solid var(--fgc-line,#e6ddd6); background:var(--fgc-soft,#fbf3ef); color:var(--fgc-text,#262626); border-radius:999px; padding:8px 14px; font:700 .8rem/1 Inter,system-ui,sans-serif; cursor:pointer; touch-action:manipulation; }
#fgSubStyle button.on{ background:linear-gradient(135deg,var(--fgc-accent,#d4705f),var(--fgc-accent-2,#b55a4a)); color:#fff; border-color:transparent; }
#fgSubStyle .sw{ width:30px; height:30px; padding:0; border-radius:50%; border:2px solid #fff; box-shadow:0 0 0 1px var(--fgc-line,#e6ddd6); }
#fgSubStyle .sw.on{ box-shadow:0 0 0 3px var(--fgc-accent,#d4705f); }
#fgSubLive{ position:absolute; text-align:center; z-index:15; width:max-content; white-space:normal; user-select:none; -webkit-user-select:none; }
#fgSubLive span{ display:inline; padding:.12em .45em; border-radius:.3em; -webkit-box-decoration-break:clone; box-decoration-break:clone; line-height:1.5; }
#stTextTools.show > *, #postTextTools[style*="flex"] > *, #postTextTools[style*="block"] > *{ flex:0 0 auto!important; height:auto!important; max-height:none!important; }
#stTextTools.show .st-colors-row, #postTextTools .st-colors-row{ height:auto!important; min-height:0!important; align-items:center!important; }
#stTextTools.show .fg-panel-x, #postTextTools .fg-panel-x{ position:fixed!important; top:calc(env(safe-area-inset-top,0px) + 14px)!important; left:14px!important; z-index:3001!important; width:40px!important; height:40px!important; border-radius:50%!important; background:rgba(255,255,255,.16)!important; color:#fff!important; border:0!important; }

#stTextTools.show .st-input-row, #stTextTools.show .fg-ta-wrap, #postTextTools .st-input-row, #postTextTools .fg-ta-wrap{ background:transparent!important; border:0!important; box-shadow:none!important; }
#stTextTools.show textarea, #postTextTools textarea#postTextInput{ padding-left:66px!important; padding-right:66px!important; }

/* il contenitore dei messaggi (toast) in basso non deve rubare i tocchi quando e' vuoto */
#toast, .toast{ pointer-events:none!important; }
/* barra disegno: X fissa a sinistra, Annulla / Cancella / Fatto fissi a destra, i colori scorrono in mezzo */
.draw-tools-bar.active > button{ position:sticky!important; z-index:3!important; flex:0 0 38px!important; width:38px!important; height:38px!important; border-radius:50%!important; display:flex!important; align-items:center!important; justify-content:center!important; background:rgba(28,28,30,.96)!important; color:#fff!important; border:1px solid rgba(255,255,255,.25)!important; font-size:1rem!important; }
.draw-tools-bar.active > button:first-of-type{ left:0!important; }
.draw-tools-bar.active > button:last-of-type{ right:0!important; background:linear-gradient(135deg,var(--fgc-accent,#d4705f),var(--fgc-accent-2,#b55a4a))!important; border-color:transparent!important; }
.draw-tools-bar.active > button:nth-last-of-type(2){ right:46px!important; }
.draw-tools-bar.active > button:nth-last-of-type(3){ right:92px!important; }
.draw-tools-bar.active > .dc:last-of-type{ margin-right:140px!important; }

#stTextTools.show .st-add-btn:not(.fg-add-inline), #postTextTools .st-add-btn:not(.fg-add-inline){ display:none!important; }

/* il vecchio "+" azzurro (stile fissato da script) resta fuori dalla vista: al suo posto c'e' "Fatto" in alto a destra */
#stTextTools.show .fg-ta-wrap, #postTextTools .fg-ta-wrap{ clip-path:inset(0 64px 0 0); -webkit-clip-path:inset(0 64px 0 0); }
.fgc-fatto{ display:none; }

/* ==========================================================================
   NIENTE PIU' OSCILLAZIONE A DESTRA/SINISTRA nell'editor (telefono e tablet)
   il pannello scorre solo in verticale; solo la striscia filtri scorre di lato
   ========================================================================== */
#postModal .modal, #storyModal .modal, #postModal .modal-body, #storyModal .modal-body{ overflow-x:hidden!important; overscroll-behavior:contain!important; }
#postModal .modal-body, #storyModal .modal-body{ touch-action:pan-y!important; }
#postModal .filters-row, #storyModal .filters-row, #storyModal .story-layout-bar, #postModal .post-layout-bar, #fgSubStyle .r{ touch-action:pan-x!important; overflow-x:auto!important; overscroll-behavior-x:contain!important; }
html:has(#postModal.show), html:has(#storyModal.show), body:has(#postModal.show), body:has(#storyModal.show){ overflow-x:hidden!important; overscroll-behavior:none!important; }

#fgSubStyle .pal{ flex:0 0 auto; display:inline-flex; align-items:center; gap:6px; padding:4px 12px 4px 4px; border-radius:999px; border:1px solid var(--fgc-line,#e6ddd6); background:var(--fgc-soft,#fbf3ef); font:700 .78rem/1 Inter,system-ui,sans-serif; color:var(--fgc-text,#262626); cursor:pointer; position:relative; }
#fgSubStyle .pal input{ -webkit-appearance:none; appearance:none; width:28px; height:28px; border:0; padding:0; border-radius:50%; background:conic-gradient(#ff3b30,#ff9500,#ffd400,#34c759,#00c7be,#007aff,#af52de,#ff2d55,#ff3b30); cursor:pointer; }
#fgSubStyle .pal input::-webkit-color-swatch-wrapper{ padding:0; } #fgSubStyle .pal input::-webkit-color-swatch{ border:2px solid #fff; border-radius:50%; background:transparent!important; }
#fgSubStyle .hint{ font-size:.72rem; color:var(--fgc-text2,#8e8e8e); text-align:center; }

/* ==========================================================================
   TABLET (769-1023): come il telefono, ma il contenuto resta centrato e non si allarga troppo
   ========================================================================== */
@media (min-width:769px) and (max-width:1023px){
  #postModal .modal-body, #storyModal .modal-body{ padding-left:max(14px, calc((100vw - 620px) / 2))!important; padding-right:max(14px, calc((100vw - 620px) / 2))!important; }
  #postModal #pubBtn, #storyModal .pub-btn{ left:max(14px, calc((100vw - 620px) / 2))!important; right:max(14px, calc((100vw - 620px) / 2))!important; }
  #storyModal:has(#storyPreview img, #storyPreview video) #storyPreviewWrap{ margin:0 0 10px!important; border-radius:22px!important; }
  #postModal .upload-zone, #storyModal .upload-zone{ margin:14px 0!important; }
}
/* ==========================================================================
   COMPUTER (1024+): stessa finestra di prima, ma anteprima a sinistra e strumenti a destra
   cosi' si vede tutto senza scorrere
   ========================================================================== */
@media (min-width:1024px){
  #postModal .modal, #storyModal .modal{ width:min(1040px, 94vw)!important; max-width:min(1040px, 94vw)!important; max-height:92vh!important; display:flex!important; flex-direction:column!important; }
  #postModal .modal-body, #storyModal .modal-body{ display:grid!important; grid-template-columns:minmax(0, 1.15fr) minmax(320px, .85fr); column-gap:24px; row-gap:10px; align-items:start; overflow-y:auto!important; max-height:calc(92vh - 64px)!important; }
  #postModal .modal-body > *, #storyModal .modal-body > *{ grid-column:2; min-width:0; }
  #postModal .modal-body > .upload-zone, #storyModal .modal-body > .upload-zone,
  #postModal .modal-body > div:has(> #previewContainer), #storyModal .modal-body > #storyPreviewWrap{ grid-column:1; grid-row:1 / span 40; position:sticky; top:0; }
  #postModal .modal-body > div:has(> #previewContainer) ~ .upload-zone{ grid-row:auto; }
  #postModal:has(#previewContainer img, #previewContainer video) .modal-body > .upload-zone,
  #storyModal:has(#storyPreview img, #storyPreview video) .modal-body > .upload-zone{ display:none!important; }
  #postModal .upload-zone, #storyModal .upload-zone{ min-height:320px!important; flex-direction:column!important; justify-content:center!important; text-align:center; }
  #postModal #previewContainer img:not([class*="overlay-el"]), #postModal #previewContainer video{ max-height:70vh!important; object-fit:contain; border-radius:14px; }
  #storyModal #storyPreviewWrap{ max-height:76vh; }
  #postModal #pubBtn, #storyModal .pub-btn{ position:sticky!important; bottom:0!important; }
}

/* Esplora: "Carica altro" nel colore del sito */
.exp-lm, #expLM{ background:linear-gradient(135deg,var(--fgc-accent,#d4705f),var(--fgc-accent-2,#b55a4a))!important; color:#fff!important; border:0!important; border-radius:999px!important; box-shadow:0 8px 18px -10px rgba(212,112,95,.9)!important; font-weight:700!important; }

/* ==========================================================================
   MODALITA' SCURA nei pannelli Crea post/storia (telefono, tablet, PC)
   la community accende lo scuro con body.dark: i colori del pannello ora lo seguono
   ========================================================================== */
body.dark, body.dark-mode, html.fgc-dark body{
  --fgc-soft:#1f1b19; --fgc-bg2:#1a1715; --fgc-page:#0e0d0c; --fgc-card:#161412; --fgc-line:#2e2926; --fgc-text:#f3eee9; --fgc-text2:#a39b94;
  --fgc-shadow:0 1px 2px rgba(0,0,0,.4),0 8px 24px -12px rgba(0,0,0,.6);
}
#postModal .modal, #storyModal .modal, #postModal .modal-head, #storyModal .modal-head, #postModal .modal-body, #storyModal .modal-body{ background:var(--fgc-card,#fff)!important; color:var(--fgc-text,#262626)!important; }
#postModal .modal-head h2, #storyModal .modal-head h2, #postModal .modal-close, #storyModal .modal-close{ color:var(--fgc-text,#262626)!important; }
#postModal .upload-zone p, #storyModal .upload-zone p, #postModal label, #storyModal label{ color:var(--fgc-text,#262626)!important; }
#postModal textarea, #storyModal textarea, #postModal input[type="text"], #storyModal input[type="text"], #postModal input:not([type]), #postModal input[type="datetime-local"]{ background:var(--fgc-soft,#fbf3ef)!important; color:var(--fgc-text,#262626)!important; border:1px solid var(--fgc-line,#e6ddd6)!important; }
#postModal textarea::placeholder, #storyModal textarea::placeholder, #postModal input::placeholder{ color:var(--fgc-text2,#8e8e8e)!important; }
/* le righe opzione (posizione, programma, sondaggio, collaboratore, abbonati) uguali su tutti gli schermi */
#postModal #locBtn, #postModal #schedToggle, #postModal #postPollToggle{ display:flex!important; align-items:center; gap:10px; width:100%!important; justify-content:flex-start!important; min-height:46px; padding:10px 16px!important; margin:0 0 8px!important; border-radius:14px!important; background:var(--fgc-soft,#fbf3ef)!important; border:1px solid var(--fgc-line,#e6ddd6)!important; color:var(--fgc-text,#262626)!important; font:600 .92rem/1.2 Inter,system-ui,sans-serif!important; text-align:left; }
#postModal .sub-toggle, #storyModal .sub-toggle, #postModal [class*="collab"], #storyModal [class*="collab"]{ background:var(--fgc-soft,#fbf3ef)!important; color:var(--fgc-text,#262626)!important; border-color:var(--fgc-line,#e6ddd6)!important; border-radius:14px!important; }
#postModal .sub-toggle *, #storyModal .sub-toggle *, #postModal [class*="collab"] *, #storyModal [class*="collab"] *{ color:var(--fgc-text,#262626)!important; }
/* zona "aggiungi foto": niente macchina fotografica anche su PC, colori giusti al buio */
#postModal .upload-zone-icon, #storyModal .upload-zone-icon{ display:none!important; }
#postModal .upload-zone, #storyModal .upload-zone{ background:var(--fgc-soft,#fbf3ef)!important; border-color:var(--fgc-line,#e6ddd6)!important; }
/* la bozza: leggibile al chiaro e al buio, e su PC occupa tutta la riga in alto */
#postModal .fgd6-banner, #storyModal .fgd6-banner{ background:var(--fgc-soft,#fbf3ef)!important; border:1px solid var(--fgc-line,#e6ddd6)!important; color:var(--fgc-text,#262626)!important; }
#postModal .fgd6-banner b, #postModal .fgd6-banner div, #storyModal .fgd6-banner b, #storyModal .fgd6-banner div{ color:var(--fgc-text,#262626)!important; }
#postModal .fgd6-banner .y, #storyModal .fgd6-banner .y{ background:linear-gradient(135deg,var(--fgc-accent,#d4705f),var(--fgc-accent-2,#b55a4a))!important; color:#fff!important; border:0!important; border-radius:999px!important; }
@media (min-width:1024px){
  #postModal .modal-body > .fgd6-banner, #storyModal .modal-body > .fgd6-banner{ grid-column:1 / -1!important; grid-row:auto!important; position:static!important; }
  #postModal .modal > .fgd6-banner, #storyModal .modal > .fgd6-banner{ margin:10px 16px 0!important; }
}
/* Pubblica disattivato: grigio pulito al buio */
body.dark #postModal #pubBtn:disabled, body.dark #storyModal .pub-btn:disabled, body.dark-mode #postModal #pubBtn:disabled{ background:#2a2523!important; color:#7d746d!important; }

.fgc-hub-pan{ display:none; }
.gm-stats-panel, #gmStatsPanel, .gamification-mobile-bar, #gamificationBar, #micro-progress-widget, .dopamine-fab-container, #dopamine-fab-overlay{ display:none!important; }

/* ==========================================================================
   FILTRI: sul telefono e tablet si cambiano scorrendo l'anteprima; sotto restano solo i nomi, piccoli
   ========================================================================== */
#fgcFiltroNome{ position:absolute; left:50%; top:42%; transform:translate(-50%,-50%) scale(.9); z-index:25; pointer-events:none; color:#fff; font:800 1.6rem/1 Inter,system-ui,sans-serif; text-shadow:0 2px 14px rgba(0,0,0,.6); opacity:0; transition:opacity .18s ease, transform .18s ease; white-space:nowrap; }
#fgcFiltroNome.on{ opacity:1; transform:translate(-50%,-50%) scale(1); }
@media (max-width:1023px){
  #storyModal .filters-row, #postModal .filters-row{ gap:6px!important; padding:4px 0 8px!important; scrollbar-width:none; }
  #storyModal .filters-row::-webkit-scrollbar, #postModal .filters-row::-webkit-scrollbar{ display:none; }
  #storyModal .filter-btn, #postModal .filter-btn{ flex:0 0 auto!important; width:auto!important; padding:7px 12px!important; border-radius:999px!important; background:var(--fgc-soft,#fbf3ef)!important; border:1px solid var(--fgc-line,#e6ddd6)!important; }
  #storyModal:has(#storyPreview img, #storyPreview video) .filter-btn{ background:rgba(255,255,255,.08)!important; border-color:rgba(255,255,255,.16)!important; }
  #storyModal .filter-btn .filter-preview, #postModal .filter-btn .filter-preview{ display:none!important; }
  #storyModal .filter-btn .filter-name, #postModal .filter-btn .filter-name{ font:700 .78rem/1 Inter,system-ui,sans-serif!important; margin:0!important; white-space:nowrap; }
  #storyModal .filter-btn.active, #postModal .filter-btn.active{ background:linear-gradient(135deg,var(--fgc-accent,#d4705f),var(--fgc-accent-2,#b55a4a))!important; border-color:transparent!important; }
  #storyModal .filter-btn.active .filter-name, #postModal .filter-btn.active .filter-name{ color:#fff!important; }
}
/* su PC le miniature restano, senza barra di scorrimento grigia */
@media (min-width:1024px){
  #storyModal .filters-row, #postModal .filters-row{ scrollbar-width:thin; }
}

/* ==========================================================================
   ULTIMO GIRO
   ========================================================================== */
/* telefono/tablet: filtri SOLO scorrendo l'anteprima, niente fila sotto */
@media (max-width:1023px){
  #storyModal .filters-row, #postModal .filters-row{ display:none!important; }
  .fgc-swipe-hint{ position:absolute; left:50%; bottom:18px; transform:translateX(-50%); z-index:24; pointer-events:none; padding:8px 14px; border-radius:999px;
    background:rgba(0,0,0,.55); color:#fff; font:700 .82rem/1 Inter,system-ui,sans-serif; -webkit-backdrop-filter:blur(6px); backdrop-filter:blur(6px); white-space:nowrap; transition:opacity .5s ease; }
  .fgc-swipe-hint.via{ opacity:0; }

  /* STORIA senza foto: la scelta occupa tutta la pagina, come Instagram */
  #storyModal:not(:has(#storyPreview img, #storyPreview video)) .modal-body > *:not(.upload-zone):not(.fgd6-banner):not(input){ display:none!important; }
  #storyModal:not(:has(#storyPreview img, #storyPreview video)) .modal-body::after{ display:none!important; }
  #storyModal:not(:has(#storyPreview img, #storyPreview video)) .upload-zone{
    margin:12px 0!important; min-height:calc(100dvh - 52px - env(safe-area-inset-top,0px) - 40px)!important; flex-direction:column!important;
    justify-content:center!important; align-items:center!important; text-align:center!important; gap:18px!important; border-radius:24px!important; border-width:2px!important; }
  #storyModal:not(:has(#storyPreview img, #storyPreview video)) .upload-zone::before{ flex:0 0 auto; width:84px; height:84px; border-radius:26px;
    background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E") center/38px no-repeat, linear-gradient(135deg,var(--fgc-accent,#d4705f),var(--fgc-accent-2,#b55a4a))!important; }
  #storyModal:not(:has(#storyPreview img, #storyPreview video)) .upload-zone::after{ display:none!important; }
  #storyModal:not(:has(#storyPreview img, #storyPreview video)) .upload-zone p{ font-size:1.1rem!important; max-width:260px; }
}
/* campi degli sticker: il tocco arriva sempre */
.stk-ov{ touch-action:manipulation; }
.stk-ov input, .stk-ov textarea{ position:relative; z-index:2; }
@media (max-width:1023px){
  #storyModal:not(:has(#storyPreview img, #storyPreview video)) .pub-btn{ display:none!important; }
}
@media (max-width:1023px){ .fgc-swipe-hint{ bottom:auto!important; top:44%!important; } }

/* ==========================================================================
   SCRIVERE DAL TELEFONO: si vede sempre dove si scrive
   ========================================================================== */
/* il foglio degli sticker sale sopra la tastiera */
.stk-ov.on{ align-items:flex-end!important; }
.stk-ov.on .stk-sh{ margin-bottom:var(--fgc-kb,0px)!important; max-height:min(72vh, calc(var(--fgc-vvh,100vh) - 16px))!important; overflow-y:auto!important; transition:margin-bottom .12s ease; }
html.fgc-tastiera .stk-ov.on .stk-gr{ display:none; }
.stk-ov input:focus, .stk-ov textarea:focus{ outline:none!important; border-color:var(--fgc-accent,#d4705f)!important; box-shadow:0 0 0 3px rgba(212,112,95,.3)!important; }
/* barra di risposta a "Fammi una domanda" */
#fgcAsk{ position:fixed; left:0; right:0; bottom:var(--fgc-kb,0px); z-index:20000; display:none; flex-direction:column; gap:8px; padding:14px 14px calc(12px + env(safe-area-inset-bottom,0px));
  background:rgba(18,16,15,.96); -webkit-backdrop-filter:blur(12px); backdrop-filter:blur(12px); border-radius:20px 20px 0 0; box-shadow:0 -10px 30px rgba(0,0,0,.35); }
#fgcAsk.on{ display:flex; }
#fgcAsk .q{ color:#fff; font:700 .95rem/1.3 Inter,system-ui,sans-serif; padding-right:40px; }
#fgcAsk .row{ display:flex; gap:8px; }
#fgcAsk input{ flex:1; min-width:0; height:46px; padding:0 14px; border-radius:14px; border:1px solid rgba(255,255,255,.2); background:#26221f; color:#fff; font:500 16px/1 Inter,system-ui,sans-serif; -webkit-user-select:text; user-select:text; }
#fgcAsk input:focus{ outline:none; border-color:var(--fgc-accent,#d4705f); }
#fgcAsk .ok{ flex:0 0 46px; height:46px; border:0; border-radius:14px; background:linear-gradient(135deg,var(--fgc-accent,#d4705f),var(--fgc-accent-2,#b55a4a)); position:relative; }
#fgcAsk .ok::after{ content:''; position:absolute; inset:0; margin:auto; width:20px; height:20px; background:#fff; -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12h15M13 6l6 6-6 6'/%3E%3C/svg%3E") center/contain no-repeat; mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12h15M13 6l6 6-6 6'/%3E%3C/svg%3E") center/contain no-repeat; }
#fgcAsk .x{ position:absolute; top:8px; right:10px; width:36px; height:36px; border:0; border-radius:50%; background:rgba(255,255,255,.12); color:#fff; font-size:1.4rem; line-height:1; }

/* ==========================================================================
   ANTEPRIMA A TUTTO SCHERMO (telefono e tablet): l'area occupa tutto lo spazio
   e fg-community-pro.js dimensiona foto/video esattamente (niente bande, disegni e testi allineati)
   ========================================================================== */
@media (max-width:1023px){
  #storyModal #storyPreview .preview-single.fgc-fit, #postModal #previewContainer .preview-single.fgc-fit{
    display:block!important; background:transparent!important; isolation:isolate; overflow:hidden!important; border-radius:0!important; max-height:none!important; height:auto!important; }
  .preview-single.fgc-fit::before{ content:''; position:absolute; left:-40px; right:-40px; top:-40px; height:calc(var(--fgc-h,100%) + 80px); z-index:-1; background:#000 var(--fgc-bg,none) center/cover no-repeat; filter:blur(26px) brightness(.5); pointer-events:none; }
  .preview-single.fgc-fit::after{ content:none!important; display:none!important; }
  .preview-single.fgc-fit > img[data-fgc-media], .preview-single.fgc-fit > video[data-fgc-media]{ display:block!important; border-radius:0!important; object-fit:contain!important; }
  #storyModal #storyPreviewWrap:has(.fgc-fit), #postModal #previewContainer:has(.fgc-fit){ width:fit-content!important; min-width:0!important; overflow:hidden!important; max-width:none!important; height:auto!important; max-height:none!important; aspect-ratio:auto!important; border-radius:0!important; background:#000!important; }
  #storyModal #storyPreview:has(.fgc-fit){ height:auto!important; max-height:none!important; aspect-ratio:auto!important; }
  /* Sottotitoli AI e Ritaglia: niente viola, colore del sito */
  #postModal #subtitleBtn, #postModal .fgd-ovbtn{ background:var(--fgc-accent,#d4705f)!important; color:#fff!important; border:0!important; }
}
#postModal #subtitleBtn, #postModal .fgd-ovbtn, #postModal label[style*="667eea"]{ background:linear-gradient(135deg,#d4705f,#b55a4a)!important; color:#fff!important; border:0!important; }
/* niente suggerimento "Scorri per i filtri" (post e storie) */
.fgc-swipe-hint{ display:none!important; }

/* DISEGNA: riga degli stili penna, sopra la barra colori, visibile solo mentre disegni */
.fgc-penne{ display:none; }
#drawToolsBar.active ~ .fgc-penne, .fgc-penne:has(~ #drawToolsBar.active){ display:flex; }
body:has(#drawToolsBar.active) .fgc-penne{ display:flex; position:fixed; left:0; right:0; bottom:calc(86px + env(safe-area-inset-bottom,0px)); z-index:100001; gap:6px; padding:6px 10px; overflow-x:auto; scrollbar-width:none; justify-content:flex-start; }
.fgc-penne::-webkit-scrollbar{ display:none; }
.fgc-penne button{ flex:0 0 auto; display:flex; flex-direction:column; align-items:center; gap:2px; min-width:58px; padding:7px 6px 5px; border:1px solid rgba(255,255,255,.18); border-radius:14px; background:rgba(20,18,17,.86); color:#f3eee9; font:600 .66rem/1.1 Inter,system-ui,sans-serif; cursor:pointer; }
.fgc-penne button svg{ width:22px; height:22px; }
.fgc-penne button.on{ background:var(--fgc-accent,#d4705f); border-color:var(--fgc-accent,#d4705f); color:#fff; box-shadow:0 6px 16px -8px rgba(212,112,95,.9); }
@media (min-width:1024px){ body:has(#drawToolsBar.active) .fgc-penne{ position:absolute; bottom:auto; } }

/* STORIA PUBBLICATA: via l'occhietto doppione accanto all'avatar in basso */
.fg-story-pill > span[onclick*="showStoryViewers"]{ display:none!important; }

/* APP INSTALLATA: spazio per la barra di stato di iPhone (orologio, batteria) */
html.fgc-pwa.fgc .header{ padding-top:calc(env(safe-area-inset-top,0px) + 8px)!important; }
#fgcBarraStato{ position:fixed; left:0; right:0; top:0; height:env(safe-area-inset-top,0px); background:var(--card,#fff); z-index:99; pointer-events:none; }
body.dark #fgcBarraStato, body.dark-mode #fgcBarraStato{ background:var(--card,#000); }

/* ANTEPRIMA A TUTTO SCHERMO: trascinando sulla foto/video la pagina scorre in giu' verso
   didascalia e opzioni (prima un altro script la bloccava e si scorreva solo in 1-2 cm) */
#postModal .preview-single.fgc-fit > [data-fgc-media], #storyModal .preview-single.fgc-fit > [data-fgc-media],
#postModal .preview-single.fgc-fit, #storyModal .preview-single.fgc-fit{ touch-action:pan-y!important; }
/* foto aggiunte sopra e ritagli: si spostano, ingrandiscono e ruotano col dito (il browser non deve rubare il gesto) */
.preview-single [class*="overlay-el"], .preview-single .fgr-pezzo, .preview-single [class*="ritagl"], .preview-single [class*="crop"]{ touch-action:none!important; }

/* BARRA IN ALTO (telefono): stesse icone a linea della barra in basso, niente emoji, niente riquadri */
html.fgc .header-right{ gap:2px!important; }
html.fgc .header-btn{ background:transparent!important; width:42px!important; height:42px!important; border-radius:12px!important; font-size:0!important; color:transparent!important; display:inline-flex!important; align-items:center; justify-content:center; position:relative; text-decoration:none; }
html.fgc .header-btn::before{ content:''; width:24px; height:24px; background:var(--text2); -webkit-mask:var(--fgc-hi) center/contain no-repeat; mask:var(--fgc-hi) center/contain no-repeat; transition:transform .15s; }
html.fgc .header-btn:active::before{ transform:scale(.86); }
html.fgc .header-btn:hover{ background:var(--fgc-soft)!important; }
html.fgc #shopBtn{ --fgc-hi:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5.5 8h13l-1 12.5h-11z'/%3E%3Cpath d='M9 8V7a3 3 0 0 1 6 0v1'/%3E%3C/svg%3E"); }
html.fgc #notifBtn, html.fgc #pushNotifBtn{ --fgc-hi:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 16.5V11a6 6 0 1 1 12 0v5.5l1.5 1.5h-15z'/%3E%3Cpath d='M10 20.5a2.2 2.2 0 0 0 4 0'/%3E%3C/svg%3E"); }
html.fgc #msgBtn{ --fgc-hi:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12a8 8 0 0 1-11.6 7.1L4 21l1.6-4.7A8 8 0 1 1 21 12z'/%3E%3C/svg%3E"); }
html.fgc .header-btn[href*="user_profile"], html.fgc .header-btn[href*="my-profile"]{ --fgc-hi:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 21a7.5 7.5 0 0 1 15 0'/%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3C/svg%3E"); }
html.fgc .header-btn .badge{ font-size:.66rem!important; color:#fff!important; top:2px!important; right:2px!important; line-height:1; }
/* tema scuro: luna/sole al posto dell'interruttore */
html.fgc .dark-toggle{ position:relative; width:42px; height:42px; display:inline-flex; align-items:center; justify-content:center; border-radius:12px; }
html.fgc .dark-toggle input{ position:absolute; opacity:0; pointer-events:none; }
html.fgc .dark-toggle label{ position:absolute!important; inset:0!important; width:auto!important; height:auto!important; background:transparent!important; border:0!important; border-radius:12px!important; cursor:pointer; display:flex!important; align-items:center; justify-content:center; }
html.fgc .dark-toggle label::before{ content:''!important; position:static!important; width:23px!important; height:23px!important; border-radius:0!important; box-shadow:none!important; transform:none!important; background:var(--text2)!important; -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.5 13.5A8.5 8.5 0 1 1 10.5 3.5a6.8 6.8 0 0 0 10 10z'/%3E%3C/svg%3E") center/contain no-repeat; mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.5 13.5A8.5 8.5 0 1 1 10.5 3.5a6.8 6.8 0 0 0 10 10z'/%3E%3C/svg%3E") center/contain no-repeat; }
html.fgc .dark-toggle label::after{ display:none!important; }
html.fgc .dark-toggle input:checked+label{ background:transparent!important; }
html.fgc .dark-toggle input:checked+label::before{ -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2.5v2M12 19.5v2M4.6 4.6l1.4 1.4M18 18l1.4 1.4M2.5 12h2M19.5 12h2M4.6 19.4 6 18M18 6l1.4-1.4'/%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3C/svg%3E") center/contain no-repeat; mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2.5v2M12 19.5v2M4.6 4.6l1.4 1.4M18 18l1.4 1.4M2.5 12h2M19.5 12h2M4.6 19.4 6 18M18 6l1.4-1.4'/%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3C/svg%3E") center/contain no-repeat; }
html.fgc .header-btn[style*="display:none"], html.fgc .header-btn[style*="display: none"]{ display:none!important; }
html.fgc .header-left h1{ white-space:nowrap; }
@media (max-width:400px){ html.fgc .header-btn, html.fgc .dark-toggle{ width:38px!important; height:40px!important; } html.fgc .header-btn::before{ width:24px; height:24px; } }

/* da non loggati: shop e accedi con le stesse icone (prima erano due quadrati neri) */
html.fgc .header-btn{ --fgc-hi:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 21a7.5 7.5 0 0 1 15 0'/%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3C/svg%3E"); }
html.fgc .header-btn[href*="shop.php"]{ --fgc-hi:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5.5 8h13l-1 12.5h-11z'/%3E%3Cpath d='M9 8V7a3 3 0 0 1 6 0v1'/%3E%3C/svg%3E"); }

/* ==========================================================================
   MENU "⋯" DEI POST (community e profilo, post tuoi e degli altri): stesso stile,
   icone a linea al posto delle emoji, colore del sito
   ========================================================================== */
.post-menu-dd, .pm-dropdown{ background:var(--card,#fff)!important; color:var(--text,#262626)!important; border:1px solid var(--border,rgba(0,0,0,.08))!important; border-radius:16px!important; padding:6px!important; box-shadow:0 16px 40px -12px rgba(0,0,0,.35)!important; min-width:210px; }
.post-menu-item, .pm-dropdown > button{ display:flex!important; align-items:center!important; gap:12px!important; width:100%!important; padding:11px 12px!important; border:0!important; background:none!important; color:var(--text,#262626)!important; font:600 .92rem/1.2 Inter,system-ui,sans-serif!important; border-radius:11px!important; text-align:left!important; cursor:pointer; }
.post-menu-item:hover, .pm-dropdown > button:hover, .post-menu-item:active, .pm-dropdown > button:active{ background:var(--fgc-soft,rgba(212,112,95,.1))!important; }
.fgc-mi{ flex:0 0 20px; width:20px; height:20px; background:currentColor; -webkit-mask:var(--fgc-mi) center/contain no-repeat; mask:var(--fgc-mi) center/contain no-repeat; }
.post-menu-item.danger, .pm-dropdown > button.fgc-danger{ color:#e0464e!important; }
.fgc-mi[data-i="share"]{ --fgc-mi:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 3 10.5 13.5'/%3E%3Cpath d='M21 3l-6.5 18-4-7.5L3 9.5z'/%3E%3C/svg%3E"); }
.fgc-mi[data-i="repost"]{ --fgc-mi:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17 2l4 4-4 4'/%3E%3Cpath d='M3 11V9a4 4 0 0 1 4-4h14'/%3E%3Cpath d='M7 22l-4-4 4-4'/%3E%3Cpath d='M21 13v2a4 4 0 0 1-4 4H3'/%3E%3C/svg%3E"); }
.fgc-mi[data-i="profile"]{ --fgc-mi:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 21a7.5 7.5 0 0 1 15 0'/%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3C/svg%3E"); }
.fgc-mi[data-i="report"]{ --fgc-mi:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 21V4'/%3E%3Cpath d='M5 4h12l-2.5 4L17 12H5'/%3E%3C/svg%3E"); }
.fgc-mi[data-i="edit"]{ --fgc-mi:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20h4L19 9l-4-4L4 16z'/%3E%3Cpath d='M13.5 6.5l4 4'/%3E%3C/svg%3E"); }
.fgc-mi[data-i="cover"]{ --fgc-mi:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h3l2-2.5h6L17 7h3a1 1 0 0 1 1 1v11a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1z'/%3E%3Ccircle cx='12' cy='13' r='3.5'/%3E%3C/svg%3E"); }
.fgc-mi[data-i="delete"]{ --fgc-mi:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h16'/%3E%3Cpath d='M10 11v6M14 11v6'/%3E%3Cpath d='M6 7l1 13h10l1-13'/%3E%3Cpath d='M9 7V4h6v3'/%3E%3C/svg%3E"); }
.fgc-mi[data-i="pin"]{ --fgc-mi:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 17v5'/%3E%3Cpath d='M8 3h8l-1 6 3 4H6l3-4z'/%3E%3C/svg%3E"); }
.fgc-mi[data-i="link"]{ --fgc-mi:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1'/%3E%3Cpath d='M14 10a4 4 0 0 0-5.7 0l-3 3a4 4 0 0 0 5.7 5.7l1-1'/%3E%3C/svg%3E"); }
.fgc-mi[data-i="save"]{ --fgc-mi:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 3h12a1 1 0 0 1 1 1v17l-7-4.5L5 21V4a1 1 0 0 1 1-1z'/%3E%3C/svg%3E"); }
.fgc-mi[data-i="hide"]{ --fgc-mi:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3l18 18'/%3E%3Cpath d='M10.6 6.1A9.8 9.8 0 0 1 12 6c5 0 9 6 9 6a15 15 0 0 1-3 3.6M6.6 6.6C4.3 8.1 3 12 3 12s4 6 9 6a8.7 8.7 0 0 0 4.4-1.2'/%3E%3C/svg%3E"); }
.fgc-mi[data-i="dots"]{ --fgc-mi:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h.01M12 12h.01M19 12h.01'/%3E%3C/svg%3E"); }
/* profilo, telefono: il menu esce come pannello dal basso (prima finiva in mezzo al testo) */
@media (max-width:767px){
  .post-modal .pm-dropdown{ position:fixed!important; left:10px!important; right:10px!important; bottom:calc(12px + env(safe-area-inset-bottom,0px))!important; top:auto!important; width:auto!important; margin:0!important; z-index:100050!important; padding:8px!important; border-radius:20px!important; animation:fgcSu .2s ease-out; }
  .post-modal .pm-dropdown > button{ padding:14px 14px!important; font-size:1rem!important; }
  @keyframes fgcSu{ from{ transform:translateY(30px); opacity:0 } to{ transform:none; opacity:1 } }
}

/* testo nell'anteprima: trascinandolo non scorre la pagina, e si afferra bene anche se piccolo */
#stTextLayer .st-text-item, #postTextLayer .st-text-item{ touch-action:none!important; -webkit-user-select:none; user-select:none; }
#stTextLayer .st-text-item::after, #postTextLayer .st-text-item::after{ content:''; position:absolute; inset:-14px; }
#stTextLayer .st-text-item.selected, #postTextLayer .st-text-item.selected{ outline-color:var(--fgc-accent,#d4705f)!important; }

/* pannello testo: non scorre, colori e caratteri sempre visibili in alto anche con la tastiera aperta */
#stTextTools.show, #postTextTools[style*="flex"], #postTextTools[style*="block"]{ overflow:hidden!important; overscroll-behavior:contain; }
#stTextTools.show .st-colors-row, #postTextTools .st-colors-row{ flex:0 0 auto; min-height:44px; padding:4px 2px 6px!important; }
#stTextTools.show .st-colors-row > *, #postTextTools .st-colors-row > *{ flex:0 0 auto; }
#stTextTools.show .st-input-row, #postTextTools .st-input-row{ flex:0 1 auto; }

/* compositore aperto: niente "tira giu' per ricaricare" del browser */
html:has(#storyModal.show), html:has(#postModal.show), html:has(#storyModal.show) body, html:has(#postModal.show) body{ overscroll-behavior:none!important; }
#storyModal, #postModal, #storyModal .modal-body, #postModal .modal-body, #stTextTools, #postTextTools{ overscroll-behavior:contain!important; }

/* niente vetro sfocato sopra foto e video del compositore: su iPhone rendeva sfocati i bottoni stessi */
#storyModal .fg-textbar, #storyModal .fg-textbar *, #postModal .fg-textbar, #postModal .fg-textbar *, #storyModal #stkTrig, #fgMuteTrig,
#storyModal .draw-tools-bar.active, .draw-tools-bar.active, #fgcFiltroNome{ -webkit-backdrop-filter:none!important; backdrop-filter:none!important; }
#storyModal .draw-tools-bar.active, .draw-tools-bar.active{ background:rgba(0,0,0,.78)!important; }
#postModal .fg-textbar button{ background:rgba(0,0,0,.58)!important; color:#fff!important; }

/* bottone FATTO del testo: grande, con la scritta, sempre in alto a destra */
#stTextTools.show .fgc-fatto, #postTextTools .fgc-fatto{ font:700 1rem/1 Inter,system-ui,sans-serif!important; color:#fff!important; gap:8px; height:46px!important; padding:0 18px 0 20px!important; letter-spacing:.2px; }
#stTextTools.show .fgc-fatto::after, #postTextTools .fgc-fatto::after{ width:20px!important; height:20px!important; }
/* mentre scrivi il testo, "Pubblica" sparisce: niente pubblicazioni per sbaglio toccando fuori */
#postModal:has(#postTextTools[style*="block"]) #pubBtn, #postModal:has(#postTextTools[style*="flex"]) #pubBtn,
#storyModal:has(#stTextTools.show) .pub-btn{ display:none!important; }
/* il pannello del testo copre sempre tutto lo schermo: toccando fuori dal testo si conferma */
#stTextTools.show, #postTextTools[style*="block"], #postTextTools[style*="flex"]{ top:0!important; bottom:0!important; left:0!important; right:0!important; height:auto!important; min-height:100dvh!important; max-height:none!important; }

/* il compositore non si sposta mai di lato (cambio filtro, scorrimento) */
#postModal .modal-body, #storyModal .modal-body{ overflow-x:hidden!important; }
#postModal .modal, #storyModal .modal{ overflow-x:hidden!important; }

/* cambio filtro / anteprima ridisegnata: la foto nuova parte gia' grande giusta, niente scatti */
@media (max-width:1023px){
  #postModal #previewContainer.fgc-box .preview-single > img:not([data-fgc-media]):not([class*="overlay"]),
  #postModal #previewContainer.fgc-box .preview-single > video:not([data-fgc-media]),
  #storyModal #storyPreviewWrap.fgc-box .preview-single > img:not([data-fgc-media]):not([class*="overlay"]),
  #storyModal #storyPreviewWrap.fgc-box .preview-single > video:not([data-fgc-media]){
    display:block!important; width:var(--fgc-w)!important; height:var(--fgc-hh)!important; max-width:none!important; max-height:none!important;
    margin:var(--fgc-mt) auto var(--fgc-mb)!important; object-fit:contain!important; border-radius:0!important; }
  #previewContainer.fgc-box .preview-single, #storyPreviewWrap.fgc-box .preview-single{ display:block!important; position:relative; background:#000; }
}

/* pannello testo spostato sopra a tutto: copre il compositore, z-index massimo */
body > #stTextTools.show, body > #postTextTools[style*="block"], body > #postTextTools[style*="flex"]{ z-index:2147483000!important; position:fixed!important; left:0!important; right:0!important; overflow:hidden!important;
  padding:calc(env(safe-area-inset-top,0px) + 66px) 16px 12px!important; }
body > #stTextTools.show .fgc-fatto, body > #postTextTools .fgc-fatto{ position:absolute!important; top:calc(env(safe-area-inset-top,0px) + 12px)!important; z-index:2147483001!important; }
body > #stTextTools.show .fg-panel-x, body > #postTextTools .fg-panel-x{ position:absolute!important; z-index:2147483001!important; }
/* ordine chiaro: colori, caratteri, poi il testo grande e ben visibile, poi la misura */
body > #stTextTools.show textarea, body > #postTextTools textarea{ display:block!important; min-height:90px!important; max-height:40vh; opacity:1!important; visibility:visible!important; }
body > #stTextTools.show .st-input-row, body > #postTextTools .st-input-row, body > #stTextTools.show .fg-ta-wrap, body > #postTextTools .fg-ta-wrap{ display:block!important; flex:0 0 auto!important; min-height:90px; }
/* intestazione della community nitida: niente strato "trasformato" (su iPhone sfocava logo e icone) */
html.fgc .header{ transition:none!important; }
html.fgc .header[style*="translateY(0)"]{ transform:none!important; }
body > #stTextTools.show .fg-ta-wrap, body > #postTextTools .fg-ta-wrap, body > #stTextTools.show .st-input-row, body > #postTextTools .st-input-row{ order:3!important; margin-top:10px; }
body > #stTextTools.show .st-colors-row, body > #postTextTools .st-colors-row{ order:1!important; }
body > #stTextTools.show .st-fonts-row, body > #postTextTools .st-fonts-row{ order:2!important; }
body > #stTextTools.show .st-size-row, body > #postTextTools .st-size-row, body > #postTextTools #postTextSizeWrap{ order:4!important; }
body > #stTextTools.show, body > #postTextTools[style*="block"], body > #postTextTools[style*="flex"]{ background:rgba(8,8,10,.82)!important; display:flex!important; flex-direction:column!important; }
body:has(> #stTextTools.show) .fg-textbar, body:has(> #stTextTools.show) #stkTrig, body:has(> #postTextTools[style*="block"]) .fg-textbar{ visibility:hidden!important; }
/* spazio sotto Fatto/✕ senza toccare il padding (un altro script lo riscriveva e il pannello saliva e scendeva) */
body > #stTextTools.show .st-colors-row, body > #postTextTools .st-colors-row{ margin-top:max(0px, calc(env(safe-area-inset-top,0px) + 66px - var(--fgc-pt,52px)))!important; }
body > #stTextTools.show, body > #postTextTools[style*="block"], body > #postTextTools[style*="flex"]{ transition:none!important; animation:none!important; }

/* STORIA: nome profilo, ora e "Vedi traduzione" sempre leggibili anche su foto chiare */
#storyViewer::before{ content:''; position:absolute; left:0; right:0; top:0; height:190px; z-index:4; pointer-events:none;
  background:linear-gradient(to bottom, rgba(0,0,0,.72) 0%, rgba(0,0,0,.4) 55%, transparent 100%); }
#storyViewer .story-progress, #storyViewer .story-header{ position:relative; z-index:6; }
#storyViewer .story-header, #storyViewer .story-header *{ color:#fff!important; text-shadow:0 1px 3px rgba(0,0,0,.75), 0 0 10px rgba(0,0,0,.35)!important; }
#storyViewer .story-header .story-user-info, #storyViewer #storyUser{ font-weight:700; }
#storyViewer .str-tr-hdr{ display:inline-flex!important; align-items:center; gap:6px; margin-top:4px; padding:4px 10px 4px 8px; border-radius:999px;
  background:rgba(0,0,0,.45)!important; color:#fff!important; font:600 .78rem/1.2 Inter,system-ui,sans-serif!important; text-shadow:none!important; width:auto!important; max-width:max-content; }
#storyViewer .str-tr-hdr *{ text-shadow:none!important; color:#fff!important; }
#storyViewer .str-tr-hdr .str-dot{ background:var(--fgc-accent,#d4705f)!important; }

/* icone della barra in alto in SVG vero (nitide) */
html.fgc .header-btn.fgc-svg::before, html.fgc .dark-toggle label.fgc-svg::before{ display:none!important; content:none!important; }
html.fgc .header .fgc-hsvg{ width:24px; height:24px; color:var(--text2); flex:0 0 24px; display:block; }
html.fgc .header .header-btn.fgc-svg{ color:transparent!important; }
html.fgc .header .dark-toggle .sole{ display:none; }
html.fgc .header .dark-toggle input:checked + label .luna{ display:none; }
html.fgc .header .dark-toggle input:checked + label .sole{ display:block; }
html.fgc .header .header-btn:active .fgc-hsvg{ transform:scale(.86); }

/* sotto i post: solo "Vedi traduzione" (via il doppione "Traduci" col mappamondo) */
.post:has(.c-tr) .fg-tr-btn, .caption:has(.c-tr) .fg-tr-btn, .content:has(.c-tr) .fg-tr-btn, .pm-post:has(.c-tr) .fg-tr-btn, .pm-overlay:has(.c-tr) .fg-tr-btn{ display:none!important; }
#storyViewer .story-progress{ margin-top:env(safe-area-inset-top,0px)!important; }
/* FG-HOME: con il bottone Home i tasti in alto stanno tutti anche sui telefoni stretti */
@media (max-width:420px){ html.fgc .header .header-btn{ width:38px!important; height:40px!important; } html.fgc .header-left .logo, html.fgc .header .logo{ font-size:1.35rem; } }

/* FG-GESTI-INTELLIGENTI: mentre trascini, il messaggio in basso non copre il cestino */
html.fgc-trascina #toast, html.fgc-trascina .toast{ opacity:0!important; transition:opacity .12s; }
#storyModal .st-text-item, #postModal .st-text-item, #storyModal [class*="overlay-el"], #postModal [class*="overlay-el"], #storyModal .stk-p, #postModal .stk-p{ touch-action:none; }

/* FG-ADESIVI-PRO: risposta immediata al tocco sui riquadri di Esplora e del profilo */
.ei,.grid-item{transition:transform .12s ease}.ei:active,.grid-item:active{transform:scale(.97)}

/* FG-ADESIVI-PRO2: il foglio di testi e adesivi non copre piu' l'anteprima: con adesivi sopra il pizzico nello spazio libero arriva alla foto */
#stTextLayer,#postTextLayer{pointer-events:none!important}#stTextLayer>*,#postTextLayer>*{pointer-events:auto}

/* FG-STK-SCORRI v2: nel foglio degli adesivi scorre una zona sola (prima scorrevano sia il foglio sia la griglia: il dito muoveva ora l'uno ora l'altra) */
.stk-ov.on .stk-sh{ overflow:hidden!important; display:flex!important; flex-direction:column!important; }
.stk-ov.on .stk-sh > *{ flex:0 0 auto; }
.stk-ov.on .stk-sh > .stk-gr, .stk-ov.on .stk-sh > .stk-fp{ flex:1 1 auto; min-height:0; max-height:none!important; overflow-y:auto!important; overflow-x:hidden; overscroll-behavior:contain; -webkit-overflow-scrolling:touch; touch-action:pan-y; }
.stk-ov{ overscroll-behavior:contain; }
/* i colori del sito anche qui: fondo caldo scuro al posto del blu-viola, tessere e icone in tinta mattone */
.stk-ov .stk-sh{ background:#161412!important; border-top:1px solid rgba(255,255,255,.08); box-shadow:0 -12px 40px rgba(0,0,0,.45); }
.stk-ov .stk-ch{ background:#1f1b19!important; border-color:rgba(255,255,255,.07)!important; }
.stk-ov .stk-ch:active{ background:#2a2523!important; }
.stk-ov .stk-ch .ic{ background:rgba(212,112,95,.14)!important; color:#e9a79b; }
/* /FG-STK-SCORRI */
