/* MeetingPart responsive hardening - 2026 */
html,body{max-width:100%;overflow-x:hidden}
img,video,iframe{max-width:100%}
button,input,select,textarea{max-width:100%}
.wrap,.home-layout,.center,.admin-shell,.admin-page-wrap,.event-pay-admin{min-width:0}
.card{min-width:0}
.btn{white-space:normal;text-align:center}
.actions,.compact-actions,.game-controls,.payment-tabs,.ep-actions{flex-wrap:wrap}
.payment-table,.ep-table{width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}

/* Mobile cards instead of wide admin tables */
@media(max-width:700px){
  .admin-shell{width:100%;padding:0 8px;margin-top:10px}
  .admin-nav-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .admin-nav-grid a{min-height:48px;display:flex;align-items:center;justify-content:center;text-align:center;padding:10px 8px}
  .admin-nav-head{gap:8px}
  .admin-shell .card{padding:13px}

  .payment-table{overflow:visible}
  .payment-head{display:none}
  .payment-row{display:grid;grid-template-columns:1fr;min-width:0;gap:7px;padding:13px 0}
  .payment-row>div{min-width:0}
  .payment-row>div:last-child{display:flex;flex-wrap:wrap;gap:5px}
  .payment-row .btn{margin:0;flex:1 1 120px}

  .event-pay-admin{width:100%;padding:0 8px;margin:10px auto 80px;box-sizing:border-box}
  .ep-head{padding:14px!important}
  .ep-head h1{font-size:21px;line-height:1.25;overflow-wrap:anywhere}
  .ep-stats{grid-template-columns:1fr 1fr!important;gap:7px!important}
  .ep-stats .card{padding:11px!important;margin:0!important}
  .ep-table{overflow:visible}
  .ep-row{display:grid!important;grid-template-columns:1fr!important;gap:8px!important;padding:12px 0!important}
  .ep-actions{display:flex!important;width:100%;gap:6px}
  .ep-actions .btn{flex:1 1 120px}
  .reject-form{display:flex;flex-wrap:wrap;gap:6px}
  .reject-form input{min-width:0;flex:1 1 180px}

  .messages-layout{min-width:0}
  .private-chat{min-height:0}
  .message-form{position:sticky;bottom:0;background:#fff;padding:8px 0 calc(8px + env(safe-area-inset-bottom,0px));z-index:8}
  .message-form textarea{min-height:44px;resize:vertical}

  .mp-messenger-grid{min-width:0!important}
  .mp-message-main,.mp-conversations,.mp-group-chat,.mp-chat-body{min-width:0!important}
  .mp-bubble{overflow-wrap:anywhere}
  .mp-group-file{max-width:100%;overflow:hidden}
  .mp-group-file span,.mp-group-file b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .mp-compose{position:sticky;bottom:0;z-index:9;padding-bottom:calc(8px + env(safe-area-inset-bottom,0px))!important}

  .profilehead{padding-left:12px;padding-right:12px}
  .profilehead .avatar{width:92px;height:92px}
  .profile-actions,.profile-head-actions{display:flex;flex-wrap:wrap;gap:7px}
  .profile-actions .btn,.profile-head-actions .btn{flex:1 1 130px}

  .cover{height:150px}
  .two{grid-template-columns:1fr!important}
  .search{flex-wrap:wrap}
  .search>*{min-width:0;flex:1 1 180px}
  .event-row{display:block}
  .event-row .btn{margin-top:7px}
  .calendar-head{gap:7px;justify-content:space-between}
  .calendar-head h2{font-size:18px}

  .method-tabs{grid-template-columns:1fr!important}
  .method-panel{padding:13px!important}
  .pay-account{align-items:flex-start;flex-direction:column}
  .pay-account .copy-btn{margin-left:0!important;width:100%}

  .games-grid{grid-template-columns:1fr!important}
  .game-lanes button{height:88px}
  .game-target{width:68px;height:68px}

  .modal,.modal-content,[role="dialog"]{max-width:calc(100vw - 20px)!important;box-sizing:border-box}
  table{max-width:100%}
}

@media(min-width:701px) and (max-width:900px){
  .messages-layout{grid-template-columns:230px minmax(0,1fr)}
  .home-layout{grid-template-columns:minmax(0,1fr) 280px}
}

/* Prevent long IDs, card numbers and usernames from breaking the layout */
strong,b,small,.muted,a,p,h1,h2,h3,h4{overflow-wrap:anywhere}
input[type=file]{overflow:hidden}

/* Chat mobile repair: restore a single-row composer and prevent the chat controls from collapsing. */
@media (max-width:700px){
  .mp-message-main{min-height:calc(100dvh - 235px)!important;height:calc(100dvh - 235px)!important;display:flex!important;flex-direction:column!important;overflow:hidden!important;padding-bottom:70px!important;box-sizing:border-box!important}
  .mp-chat-header{flex:0 0 auto!important;display:flex!important;flex-wrap:wrap!important;min-width:0!important}
  .mp-chat-head-info{min-width:0!important;flex:1 1 90px!important}
  .mp-private-search{order:10!important;display:flex!important;flex:1 1 100%!important;width:100%!important;max-width:none!important;margin:4px 0 0!important;min-width:0!important}
  .mp-private-search input{flex:1 1 auto!important;width:auto!important;min-width:0!important;max-width:none!important;box-sizing:border-box!important}
  .mp-private-search .btn{flex:0 0 auto!important;white-space:nowrap!important}
  .mp-chat-body{flex:1 1 auto!important;min-height:0!important;height:auto!important;overflow-y:auto!important;overflow-x:hidden!important;padding:10px!important}

  .mp-compose{position:relative!important;left:auto!important;right:auto!important;bottom:auto!important;display:grid!important;grid-template-columns:32px 32px minmax(0,1fr) 36px!important;align-items:center!important;gap:5px!important;width:100%!important;min-width:0!important;box-sizing:border-box!important;flex:0 0 auto!important;padding:6px 7px!important;margin:0!important;z-index:5!important}
  .mp-compose .mp-attach-btn{grid-column:1!important;grid-row:1!important;width:32px!important;height:32px!important;min-width:32px!important;max-width:32px!important;flex:0 0 32px!important}
  .mp-compose .mp-voice-btn{grid-column:2!important;grid-row:1!important;width:32px!important;height:32px!important;min-width:32px!important;max-width:32px!important;padding:0!important}
  .mp-compose textarea{grid-column:3!important;grid-row:1!important;width:100%!important;min-width:0!important;max-width:none!important;height:36px!important;min-height:36px!important;max-height:90px!important;box-sizing:border-box!important;resize:none!important;padding:7px 10px!important}
  .mp-compose .mp-send{grid-column:4!important;grid-row:1!important;width:36px!important;height:36px!important;min-width:36px!important;max-width:36px!important;padding:0!important;flex:0 0 36px!important}

  .mp-group-chat .mp-compose{grid-template-columns:minmax(0,1fr) 36px!important}
  .mp-group-chat .mp-compose .mp-compose-tools{grid-column:1!important;grid-row:1!important;display:flex!important;align-items:center!important;gap:4px!important;min-width:0!important}
  .mp-group-chat .mp-compose .mp-attach-btn,.mp-group-chat .mp-compose .mp-voice-btn{width:32px!important;height:32px!important;min-width:32px!important;max-width:32px!important;flex:0 0 32px!important}
  .mp-group-chat .mp-compose textarea{grid-column:1!important;grid-row:2!important;width:100%!important;height:36px!important;min-height:36px!important;max-width:none!important}
  .mp-group-chat .mp-compose .mp-send{grid-column:2!important;grid-row:1 / span 2!important;align-self:center!important}
}
