/* Flatcast Chat V11 - Mobile Experience Pro */
:root{--fc-v11-safe-bottom:env(safe-area-inset-bottom,0px);--fc-v11-safe-top:env(safe-area-inset-top,0px);--fc-v11-vh:100dvh}
.fc-v11-mobilebar{display:none}
.fc-v11-scrim{display:none}
.fc-v11-grabber{display:none}
@media(max-width:767px){
  html.fc-v11-chat-active,html.fc-v11-chat-active body{overscroll-behavior-y:none}
  body.fc-v11-chat-active{padding-bottom:calc(64px + var(--fc-v11-safe-bottom))}
  .fc-anachat-page,.fc-chat-shell{touch-action:pan-y pinch-zoom}
  .fc-chat-shell{border-radius:16px;min-height:min(760px,calc(var(--fc-v11-vh) - 92px));overflow:hidden}
  .fc-chat-shell.is-fullscreen{height:var(--fc-v11-vh)!important;min-height:var(--fc-v11-vh)!important;padding-top:var(--fc-v11-safe-top);padding-bottom:calc(62px + var(--fc-v11-safe-bottom))}
  .fc-chat-shell.is-fullscreen .fc-chat-body{min-height:0!important;flex:1 1 auto}
  .fc-chat-shell.is-fullscreen .fc-chat-messages{height:auto!important;max-height:none!important;min-height:0!important}
  .fc-chat-shell.is-fullscreen .fc-chat-composer{position:relative;z-index:12}
  .fc-chat-body{min-height:calc(var(--fc-v11-vh) - 330px)}
  .fc-chat-messages{max-height:calc(var(--fc-v11-vh) - 350px)!important;scrollbar-width:thin;-webkit-overflow-scrolling:touch;overscroll-behavior:contain}
  .fc-chat-composer{padding:9px 9px calc(9px + var(--fc-v11-safe-bottom));position:relative;z-index:30}
  .fc-chat-composer textarea{font-size:16px!important;line-height:1.35;resize:none!important}
  .fc-chat-toolbar{scrollbar-width:none;overflow-x:auto!important}.fc-chat-toolbar::-webkit-scrollbar{display:none}
  .fc-chat-radio{padding:8px 9px}
  .fc-chat-statusbar{display:none!important}

  .fc-v11-mobilebar{position:fixed;left:8px;right:8px;bottom:calc(7px + var(--fc-v11-safe-bottom));z-index:10072;height:54px;padding:4px 6px;display:grid;grid-template-columns:repeat(5,1fr);align-items:stretch;gap:3px;border:1px solid rgba(148,163,184,.2);border-radius:18px;background:rgba(6,13,23,.93);backdrop-filter:blur(18px) saturate(140%);box-shadow:0 14px 42px rgba(0,0,0,.48)}
  .fc-v11-mobilebar button,.fc-v11-mobilebar a{appearance:none;border:0;background:transparent;color:#9fb1c5;text-decoration:none;border-radius:13px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;min-width:0;padding:3px 2px;font:700 10px/1.1 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;position:relative}
  .fc-v11-mobilebar .fc-v11-icon{font-size:20px;line-height:1}.fc-v11-mobilebar .fc-v11-label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
  .fc-v11-mobilebar button:active,.fc-v11-mobilebar a:active,.fc-v11-mobilebar .is-active{background:rgba(14,165,233,.15);color:#e8f6ff}
  .fc-v11-mobilebar .fc-v11-badge{position:absolute;top:2px;right:8px;min-width:17px;height:17px;border-radius:99px;background:#ef4444;color:#fff;border:2px solid #08111d;display:grid;place-items:center;padding:0 3px;font:800 9px/13px system-ui}
  .fc-v11-scrim{position:fixed;inset:0;z-index:10055;background:rgba(2,6,23,.55);backdrop-filter:blur(2px)}
  .fc-chat-shell.show-mobile-sidebar .fc-v11-scrim{display:block}
  .fc-chat-sidebar{top:calc(8px + var(--fc-v11-safe-top))!important;right:7px!important;bottom:calc(67px + var(--fc-v11-safe-bottom))!important;width:min(330px,88vw)!important;border-radius:19px!important;z-index:10060!important;overscroll-behavior:contain}
  .fc-chat-shell.show-mobile-sidebar .fc-chat-sidebar{transform:translateX(0)!important}
  .fc-v11-grabber{display:block;width:42px;height:4px;border-radius:999px;background:rgba(148,163,184,.42);margin:0 auto 7px}

  /* V7 emoji/GIF panel becomes a real mobile bottom sheet. */
  .fc-chat-emoji-popup{position:fixed!important;left:0!important;right:0!important;top:auto!important;bottom:calc(0px + var(--fc-v11-safe-bottom))!important;width:100vw!important;max-width:none!important;height:min(72dvh,620px)!important;max-height:min(72dvh,620px)!important;border-radius:24px 24px 0 0!important;border-left:0!important;border-right:0!important;border-bottom:0!important;padding:10px 12px 14px!important;z-index:10110!important;box-shadow:0 -24px 70px rgba(0,0,0,.62)!important;transform:translateY(105%);opacity:0;display:block!important;visibility:hidden;pointer-events:none;transition:transform .24s ease,opacity .18s ease,visibility 0s linear .24s}
  .fc-chat-emoji-popup.show{transform:translateY(0);opacity:1;visibility:visible;pointer-events:auto;transition-delay:0s}
  .fc-chat-emoji-popup::before{content:'';display:block;width:44px;height:4px;border-radius:99px;background:rgba(148,163,184,.45);margin:0 auto 8px}
  .fc-chat-emoji-popup-head{position:sticky;top:0;z-index:2;margin-bottom:7px;background:rgba(8,10,15,.96)}
  .fc-chat-emoji-grid{max-height:none!important;overflow:visible!important;grid-template-columns:repeat(4,minmax(0,1fr))!important}
  .fc-v7-emoji-tools,.fc-v7-tabs,.fc-v7-categories{flex:0 0 auto}
  #fcRoomEmojiPopup{overflow-y:auto!important;overscroll-behavior:contain}
  .fc-chat-emoji-bar{position:fixed;left:7px;right:7px;bottom:calc(67px + var(--fc-v11-safe-bottom));z-index:10100;margin:0!important;padding:10px!important;border:1px solid rgba(148,163,184,.18);border-radius:19px;background:rgba(7,17,29,.96);box-shadow:0 18px 55px rgba(0,0,0,.55);transform:translateY(calc(100% + 90px));opacity:0;pointer-events:none;transition:transform .22s ease,opacity .18s ease}
  .fc-chat-shell.fc-v11-quick-emoji-open .fc-chat-emoji-bar{transform:translateY(0);opacity:1;pointer-events:auto}

  /* Inline PM is full-screen on phones. */
  .fc-pm-v3-overlay{padding:0!important;align-items:stretch!important;background:#040a12!important;z-index:10130!important}
  .fc-pm-v3-window{width:100vw!important;height:var(--fc-v11-vh)!important;max-height:none!important;border:0!important;border-radius:0!important;padding-top:var(--fc-v11-safe-top);padding-bottom:var(--fc-v11-safe-bottom)}
  .fc-pm-v3-head{min-height:58px!important}.fc-pm-v3-messages{min-height:0!important}.fc-pm-v3-composer textarea{font-size:16px!important}

  /* Dedicated PM page: conversations become a swipe drawer. */
  .fcpm-page{padding:0!important}.fcpm-app{border-radius:0!important;min-height:var(--fc-v11-vh)!important;border-left:0!important;border-right:0!important}
  .fcpm-layout{display:block!important;min-height:calc(var(--fc-v11-vh) - 60px)!important;position:relative;overflow:hidden}
  .fcpm-chat{height:calc(var(--fc-v11-vh) - 60px)!important;min-height:0!important}
  .fcpm-messages{height:auto!important;max-height:none!important;min-height:0!important;flex:1!important;-webkit-overflow-scrolling:touch}
  .fcpm-composer textarea{font-size:16px!important;resize:none!important}
  .fcpm-conversations{position:absolute!important;left:0;top:0;bottom:0;width:min(340px,88vw)!important;z-index:50;transform:translateX(-105%);transition:transform .24s ease;box-shadow:22px 0 60px rgba(0,0,0,.5)}
  .fcpm-app.fc-v11-pm-drawer-open .fcpm-conversations{transform:translateX(0)}
  .fcpm-app.fc-v11-pm-drawer-open::after{content:'';position:absolute;inset:0;z-index:45;background:rgba(2,6,23,.55);backdrop-filter:blur(2px)}
  .fcpm-conversations{z-index:55}.fcpm-chat{position:relative;z-index:1}
  .fcpm-side-head{height:auto!important;padding:10px!important;border-bottom:1px solid rgba(148,163,184,.12)!important}.fcpm-side-head>div strong,.fcpm-side-head>div span,.fcpm-side-head input{display:block!important}.fcpm-side-head input{font-size:.78rem!important;height:38px!important}
  .fcpm-conv{display:grid!important;grid-template-columns:42px minmax(0,1fr) auto!important;justify-content:initial!important}.fcpm-conv-copy{display:block!important}.fcpm-conv-meta{display:flex!important}
  .fcpm-preferences label span{display:inline!important}.fcpm-preferences label{justify-content:flex-start!important}
  .fc-v11-pm-drawer-btn{display:inline-flex!important}

  body.fc-v11-keyboard-open .fc-v11-mobilebar{transform:translateY(120%);pointer-events:none}
  body.fc-v11-keyboard-open{padding-bottom:0}
  body.fc-v11-keyboard-open .fc-chat-shell.is-fullscreen{padding-bottom:var(--fc-v11-safe-bottom)}
  body.fc-v11-keyboard-open .fc-chat-messages{max-height:calc(var(--fc-v11-vh) - 255px)!important}
}
@media(min-width:768px){.fc-v11-pm-drawer-btn{display:none!important}}
@media(prefers-reduced-motion:reduce){.fc-chat-sidebar,.fc-chat-emoji-popup,.fc-chat-emoji-bar,.fcpm-conversations{transition:none!important}}

/* === Flatcast V12 FINAL FIX6: mobile fullscreen width normalization === */
@media(max-width:767px){
  html.fc-v11-mobile-fullscreen,html.fc-v11-mobile-fullscreen body,
  body.fc-v11-mobile-fullscreen{width:100%!important;max-width:100%!important;overflow-x:hidden!important}
  body.fc-v11-mobile-fullscreen{margin:0!important;padding-left:0!important;padding-right:0!important}
  .fc-chat-shell.is-fullscreen{
    left:0!important;right:auto!important;top:0!important;bottom:auto!important;
    width:var(--fc-v11-vw,100vw)!important;max-width:var(--fc-v11-vw,100vw)!important;min-width:0!important;
    height:var(--fc-v11-vh,100dvh)!important;max-height:var(--fc-v11-vh,100dvh)!important;
    margin:0!important;box-sizing:border-box!important;transform:none!important;overflow:hidden!important;
  }
  .fc-chat-shell.is-fullscreen>.fc-chat-topbar,
  .fc-chat-shell.is-fullscreen>.fc-chat-toolbar,
  .fc-chat-shell.is-fullscreen>.fc-chat-body,
  .fc-chat-shell.is-fullscreen>.fc-chat-composer,
  .fc-chat-shell.is-fullscreen>.fc-chat-statusbar,
  .fc-chat-shell.is-fullscreen>.fc-desktop-eq-wrap{
    width:100%!important;max-width:100%!important;min-width:0!important;box-sizing:border-box!important;
  }
  .fc-chat-shell.is-fullscreen .fc-chat-body{
    display:grid!important;grid-template-columns:minmax(0,1fr)!important;grid-template-rows:minmax(0,1fr)!important;
    flex:1 1 0!important;min-height:0!important;height:auto!important;overflow:hidden!important;
  }
  .fc-chat-shell.is-fullscreen .fc-chat-messages{
    grid-column:1!important;grid-row:1!important;width:100%!important;max-width:100%!important;min-width:0!important;
    height:100%!important;max-height:none!important;box-sizing:border-box!important;border-right:0!important;
    overflow-x:hidden!important;overflow-y:auto!important;
  }
  .fc-chat-shell.is-fullscreen .fc-chat-message,
  .fc-chat-shell.is-fullscreen .fc-chat-line-head,
  .fc-chat-shell.is-fullscreen .fc-chat-text{
    max-width:100%!important;min-width:0!important;box-sizing:border-box!important;
  }
  .fc-chat-shell.is-fullscreen .fc-chat-composer,
  .fc-chat-shell.is-fullscreen .fc-chat-composer-row{
    width:100%!important;max-width:100%!important;min-width:0!important;box-sizing:border-box!important;
  }
  .fc-chat-shell.is-fullscreen .fc-chat-composer-row textarea#fcChatInput{
    width:auto!important;max-width:none!important;min-width:0!important;flex:1 1 0!important;box-sizing:border-box!important;
  }
  .fc-chat-shell.is-fullscreen .fc-chat-sidebar{
    position:fixed!important;grid-column:auto!important;grid-row:auto!important;
  }
}
