/* =============================================================
   TLGAWY V72 — single mobile geometry + docked emoji + ultra-lite
   ============================================================= */
@media (max-width:900px){
  /* One layout class only. Old keyboard classes are deliberately not used. */
  body.tlgawy-keyboard-v72{overflow:hidden!important;overscroll-behavior:none!important}
  body.tlgawy-keyboard-v72 #chat_toping{display:none!important;height:0!important;min-height:0!important;overflow:hidden!important}

  body.tlgawy-keyboard-v72 #wrap_footer,
  body.tlgawy-main-emoji-open #wrap_footer{
    display:block!important;visibility:visible!important;opacity:1!important;pointer-events:auto!important;
    position:fixed!important;top:var(--tlgawy-footer-top)!important;right:0!important;bottom:auto!important;left:0!important;
    width:100%!important;height:var(--tlgawy-footer-height,50px)!important;min-height:var(--tlgawy-footer-height,50px)!important;
    max-height:var(--tlgawy-footer-height,50px)!important;margin:0!important;transform:none!important;z-index:2147483001!important;
  }
  body.tlgawy-keyboard-v72 #my_menu,
  body.tlgawy-main-emoji-open #my_menu{
    display:table!important;width:100%!important;height:100%!important;min-height:0!important;table-layout:fixed!important;
  }

  body.tlgawy-keyboard-v72 #top_chat_container,
  body.tlgawy-main-emoji-open #top_chat_container{
    display:block!important;position:fixed!important;top:var(--tlgawy-composer-top)!important;right:0!important;bottom:auto!important;left:0!important;
    width:100%!important;height:var(--tlgawy-input-height,48px)!important;min-height:var(--tlgawy-input-height,48px)!important;
    max-height:var(--tlgawy-input-height,48px)!important;margin:0!important;transform:none!important;visibility:visible!important;opacity:1!important;
    overflow:visible!important;z-index:2147483003!important;
  }
  body.tlgawy-keyboard-v72 #container_input,
  body.tlgawy-keyboard-v72 #main_input,
  body.tlgawy-keyboard-v72 #main_input .input_table,
  body.tlgawy-keyboard-v72 #main_input_box,
  body.tlgawy-keyboard-v72 #content,
  body.tlgawy-keyboard-v72 #submit_button{visibility:visible!important;opacity:1!important}

  body.tlgawy-keyboard-v72 #global_chat,
  body.tlgawy-main-emoji-open #global_chat{
    position:fixed!important;top:calc(var(--tlgawy-visual-offset-top,0px) + var(--tlgawy-head-height,0px))!important;
    right:0!important;bottom:auto!important;left:0!important;width:100%!important;height:var(--tlgawy-chat-height)!important;
    min-height:0!important;max-height:var(--tlgawy-chat-height)!important;overflow:hidden!important;transform:none!important;
  }
  body.tlgawy-keyboard-v72 #chat_center,
  body.tlgawy-main-emoji-open #chat_center{position:relative!important;width:100%!important;height:100%!important;min-height:0!important;overflow:hidden!important}
  body.tlgawy-keyboard-v72 #warp_show_chat,
  body.tlgawy-main-emoji-open #warp_show_chat{
    position:absolute!important;top:0!important;right:0!important;left:0!important;bottom:auto!important;
    width:100%!important;height:var(--tlgawy-chat-body-height)!important;max-height:var(--tlgawy-chat-body-height)!important;
    min-height:0!important;overflow:hidden!important;padding-bottom:0!important;box-sizing:border-box!important;
  }
  body.tlgawy-keyboard-v72 #show_chat ul,
  body.tlgawy-main-emoji-open #show_chat ul{scroll-behavior:auto!important}

  /* V73: the emoji drawer is ABOVE the composer. The composer remains directly
     above the footer, so emoji never appears under the typing field. */
  body.tlgawy-main-emoji-open #main_emoticon.tlgawy-emoji-open{
    display:block!important;visibility:visible!important;opacity:1!important;pointer-events:auto!important;
    position:fixed!important;top:var(--tlgawy-emoji-top)!important;right:0!important;bottom:auto!important;left:0!important;
    width:100%!important;max-width:100%!important;height:var(--tlgawy-emoji-height,260px)!important;
    min-height:180px!important;max-height:340px!important;margin:0!important;border-radius:0!important;box-sizing:border-box!important;
    overflow:hidden!important;z-index:2147483002!important;
  }
  body.tlgawy-main-emoji-open #main_emoticon .emo_head{height:40px!important;min-height:40px!important}
  body.tlgawy-main-emoji-open #main_emo.emo_content{
    display:flex!important;height:calc(100% - 40px)!important;max-height:calc(100% - 40px)!important;
    overflow-y:auto!important;overflow-x:hidden!important;overscroll-behavior:contain!important;touch-action:pan-y!important;
  }

  /* Emoji and keyboard are mutually exclusive on mobile. */
  body.tlgawy-keyboard-v72 #main_emoticon{display:none!important}

  /* Ultra-lite paint path for phones. Functional media/calls remain untouched. */
  html.tlgawy-mobile-lite body .chat_log,
  html.tlgawy-mobile-lite body .private_logs,
  html.tlgawy-mobile-lite body .online_user,
  html.tlgawy-mobile-lite body .offline_user,
  html.tlgawy-mobile-lite body .room_element,
  html.tlgawy-mobile-lite body .in_room_element,
  html.tlgawy-mobile-lite body .float_menu,
  html.tlgawy-mobile-lite body .modal_box,
  html.tlgawy-mobile-lite body .modal_content,
  html.tlgawy-mobile-lite body #chat_right,
  html.tlgawy-mobile-lite body #chat_left,
  html.tlgawy-mobile-lite body #top_chat_container,
  html.tlgawy-mobile-lite body #wrap_footer{
    
    
  }
  html.tlgawy-mobile-lite body .chat_log,
  html.tlgawy-mobile-lite body .private_logs{contain:layout style!important}
}

/* =============================================================
   TLGAWY V84 — ONE authoritative mobile private layout
   ============================================================= */
@media (max-width:800px){
  /* The private panel owns the entire visible area between the chat header and
     the normal bottom footer.  The composer is a REAL flex row inside the panel;
     it is never fixed/absolute and therefore cannot disappear on first open. */
  body.tlgawy-private-open #private_center:not(.privhide){
    display:block!important;
    position:fixed!important;
    top:calc(var(--tlgawy-visual-offset-top,0px) + var(--tlgawy-head-height,50px))!important;
    right:0!important;bottom:auto!important;left:0!important;
    width:100%!important;
    height:calc(var(--tlgawy-footer-top,calc(100dvh - 50px)) - var(--tlgawy-visual-offset-top,0px) - var(--tlgawy-head-height,50px))!important;
    min-height:140px!important;max-height:none!important;
    margin:0!important;padding:0!important;overflow:hidden!important;
    transform:none!important;box-sizing:border-box!important;z-index:360!important;
    border-radius:0!important;
  }

  body.tlgawy-private-open #private_center #private_box{
    display:flex!important;flex-direction:column!important;
    position:relative!important;inset:auto!important;
    width:100%!important;height:100%!important;min-height:0!important;max-height:none!important;
    margin:0!important;padding:0!important;overflow:hidden!important;box-sizing:border-box!important;
  }

  body.tlgawy-private-open #private_center #private_top{
    display:table!important;flex:0 0 auto!important;
    position:relative!important;inset:auto!important;
    width:100%!important;height:auto!important;min-height:40px!important;max-height:none!important;
    margin:0!important;box-sizing:border-box!important;z-index:4!important;
  }

  body.tlgawy-private-open #private_center #private_wrap_content{
    display:block!important;flex:1 1 0!important;
    position:relative!important;inset:auto!important;
    width:100%!important;height:auto!important;min-height:0!important;max-height:none!important;
    margin:0!important;padding:0!important;overflow:hidden!important;box-sizing:border-box!important;
  }

  body.tlgawy-private-open #private_center #private_content{
    display:block!important;position:relative!important;inset:auto!important;
    width:100%!important;height:100%!important;min-height:0!important;max-height:none!important;
    margin:0!important;padding:0!important;overflow:hidden!important;box-sizing:border-box!important;
  }
  body.tlgawy-private-open #private_center #inside_wrap_private,
  body.tlgawy-private-open #private_center #show_private_wrap{
    position:absolute!important;inset:0!important;width:100%!important;height:auto!important;
    min-height:0!important;max-height:none!important;margin:0!important;overflow:hidden!important;box-sizing:border-box!important;
  }
  body.tlgawy-private-open #private_center #show_private{
    position:absolute!important;inset:0!important;width:100%!important;height:auto!important;
    min-height:0!important;max-height:none!important;margin:0!important;padding:8px 7px 10px!important;
    overflow-y:auto!important;overflow-x:hidden!important;-webkit-overflow-scrolling:touch!important;
    overscroll-behavior-y:contain!important;touch-action:pan-y!important;scroll-behavior:auto!important;box-sizing:border-box!important;
  }

  /* Critical V84 rule: composer is the last flex row INSIDE #private_box. */
  body.tlgawy-private-open #private_center #priv_input{
    display:block!important;visibility:visible!important;opacity:1!important;
    flex:0 0 auto!important;position:relative!important;inset:auto!important;
    width:100%!important;height:auto!important;min-height:48px!important;max-height:none!important;
    margin:0!important;padding:0!important;transform:none!important;overflow:visible!important;
    box-sizing:border-box!important;z-index:6!important;
  }
  body.tlgawy-private-open #private_center #private_input:not(.hidden),
  body.tlgawy-private-open #private_center #private_disabled:not(.hidden),
  body.tlgawy-private-open #private_center #private_load:not(.hidden){display:block!important;}
  body.tlgawy-private-open #private_center #private_input,
  body.tlgawy-private-open #private_center #private_disabled,
  body.tlgawy-private-open #private_center #private_load,
  body.tlgawy-private-open #private_center #message_form,
  body.tlgawy-private-open #private_center #message_form .input_table{
    position:relative!important;inset:auto!important;width:100%!important;max-width:100%!important;box-sizing:border-box!important;
  }
  body.tlgawy-private-open #private_center #private_input{padding:4px!important;}
  body.tlgawy-private-open #private_center #message_form{height:auto!important;min-height:40px!important;}
  body.tlgawy-private-open #private_center #message_form .input_table{display:table!important;table-layout:fixed!important;height:40px!important;}

  /* Public composer must not compete with the private composer. */
  body.tlgawy-private-open #top_chat_container,
  body.tlgawy-private-open #main_input,
  body.tlgawy-private-open #main_input_extra,
  body.tlgawy-private-open #main_emoticon,
  body.tlgawy-private-open #quote_controller{display:none!important;visibility:hidden!important;pointer-events:none!important;}

  body.tlgawy-private-open #private_paneling,
  body.tlgawy-private-open #private_boxing{display:none!important;}

  /* Footer keeps the one V72 geometry source and stays directly below private. */
  body.tlgawy-private-open #wrap_footer{
    display:block!important;visibility:visible!important;opacity:1!important;pointer-events:auto!important;
    position:fixed!important;top:var(--tlgawy-footer-top)!important;right:0!important;bottom:auto!important;left:0!important;
    width:100%!important;height:var(--tlgawy-footer-height,var(--tlgawy-menu-height,50px))!important;
    min-height:var(--tlgawy-footer-height,var(--tlgawy-menu-height,50px))!important;
    max-height:var(--tlgawy-footer-height,var(--tlgawy-menu-height,50px))!important;
    margin:0!important;transform:none!important;z-index:2147483001!important;
  }
  body.tlgawy-private-open #my_menu{
    display:table!important;visibility:visible!important;opacity:1!important;
    width:100%!important;height:100%!important;min-height:0!important;table-layout:fixed!important;
  }
}
