/* LEMMIQ 3.0 — mobile-first compact layout, preserves functional controls */
:root{--v300-accent:#6c4dff;--v300-line:rgba(140,130,180,.24)}
#androidBtnTop,#installBtn{display:none!important}
.v300-back,.v300-qmenu,.v300-chatmenu{display:none}
#v2134PersonalTabs{display:none!important}
.home317-tabs{padding:6px!important;gap:4px!important}.home317-tabs button{padding:8px 9px!important;min-height:40px;font-size:13px!important}
#view-more .more-grid{display:grid;grid-template-columns:1fr!important;gap:5px!important}
#view-more .more-card{min-height:56px!important;padding:10px 14px!important;text-align:left;display:grid!important;grid-template-columns:32px 1fr;gap:2px 10px;align-items:center;border-radius:12px!important}
#view-more .more-card span{grid-row:1/3;font-size:20px}#view-more .more-card small{grid-column:2;font-size:11px}
.v300-wallet-tabs{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;overflow:visible!important;margin:10px 0}
.v300-wallet-tabs button{white-space:normal!important;min-width:0!important;min-height:43px!important;font-size:12px!important}
.v300-predict-switch{display:flex;gap:6px;margin:0 0 12px}.v300-predict-switch button{flex:1;min-height:44px;font-size:13px}.v300-predict-switch button[aria-selected=true]{background:#6c4dff;color:white}
#v300Trading{color:inherit}.v300-pool{border:1px solid var(--v300-line);border-radius:15px;padding:14px;margin:8px 0}.v300-pool h3{margin:0 0 8px}.v300-pool dl{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:12px 0}.v300-pool dt{font-size:12px;opacity:.8}.v300-pool dd{margin:4px 0 0;font-weight:600}.v300-soon{font-size:12px;color:inherit;border:1px solid var(--v300-line);padding:8px;border-radius:8px}.v300-preview-note{font-size:12px;line-height:1.5;opacity:.9}
.v300-action-list{display:grid;gap:8px}.v300-action-list button{min-height:44px;text-align:left}.v300-jump{position:absolute;right:12px;bottom:90px;z-index:10;border-radius:30px!important}
#view-calls .calls317-shell{min-height:0!important;padding:10px!important;border-radius:12px!important}#view-calls .calls317-head h3{font-size:20px!important}
.msg a{color:inherit;text-decoration:underline;text-underline-offset:3px}.msg .meta{font-size:10px}.msg.v300-pending .meta{opacity:.8}
@media(max-width:850px){
 .app-shell .topbar{height:auto!important;min-height:48px!important;padding:7px 12px!important;margin:0 0 5px!important;border-radius:0!important}.topbar #pageSub{display:none}.topbar h2{font-size:20px!important}.top-actions button{min-height:38px!important;padding:6px 10px!important}
 body.v300-conversation .topbar,body.v300-conversation .sidebar,body.v300-conversation #globalQOrb,body.v300-conversation #v2134PersonalTabs{display:none!important}
 body.v300-conversation .app-shell{display:block!important;padding:0!important;margin:0!important;height:var(--v300-vh,100dvh)!important;max-height:var(--v300-vh,100dvh)!important;overflow:hidden!important}
 body.v300-conversation .workspace{height:100%!important;padding:0!important;margin:0!important;min-height:0!important;overflow:hidden!important}
 body.v300-conversation #view-chats.active,body.v300-conversation .chat-layout.open-chat{height:100%!important;min-height:0!important;max-height:none!important;margin:0!important;padding:0!important}
 body.v300-conversation .chat-layout.open-chat{display:flex!important;flex-direction:column!important;gap:0!important;grid-template-columns:1fr!important}
 body.v300-conversation .chat-layout.open-chat .conversation-list{display:none!important}
 body.v300-conversation .chat-pane{display:flex!important;flex-direction:column!important;flex:1;min-height:0!important;height:100%!important;border:0!important;border-radius:0!important;margin:0!important;padding:0!important;overflow:hidden!important}
 body.v300-conversation .chat-inner:not(.hidden){display:flex!important;flex-direction:column;height:100%!important;min-height:0!important;overflow:hidden!important}
 body.v300-conversation .chat-head{flex:0 0 auto;padding:6px 8px!important;min-height:53px!important;gap:5px!important;border-radius:0!important}
 body.v300-conversation .chat-person{flex:1;min-width:0;gap:8px!important}body.v300-conversation .chat-person>div:last-child{min-width:0}body.v300-conversation .chat-person strong,body.v300-conversation .chat-person small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}body.v300-conversation .chat-person small{font-size:10px!important}
 body.v300-conversation .avatar.big{width:38px!important;height:38px!important;flex:0 0 38px!important}body.v300-conversation .chat-head-actions{flex:0 0 auto;gap:2px!important;display:flex!important;flex-wrap:nowrap!important}
 body.v300-conversation .chat-head-actions button,.v300-back{width:38px!important;min-width:38px!important;height:42px!important;padding:0!important;border:0!important;background:transparent!important;font-size:19px!important}
 body.v300-conversation .v300-back,body.v300-conversation .v300-qmenu,body.v300-conversation .v300-chatmenu{display:inline-flex!important;align-items:center;justify-content:center}
 body.v300-conversation #chatSearchBtn,body.v300-conversation #chatAiBtn,body.v300-conversation #summaryBtn,body.v300-conversation #businessChatBtn,body.v300-conversation #chatMoreBtn,body.v300-conversation #groupSuggestTop,body.v300-conversation #groupCatchupBtn,body.v300-conversation #groupQBtn,body.v300-conversation #groupSettingsBtn{display:none!important}
 body.v300-conversation .messages{flex:1 1 auto!important;min-height:0!important;height:auto!important;overflow-y:auto!important;padding:9px!important;overscroll-behavior:contain}
 body.v300-conversation .composer{flex:0 0 auto!important;position:relative!important;bottom:auto!important;gap:4px!important;padding:6px 7px calc(6px + env(safe-area-inset-bottom,0px))!important;border-radius:0!important;display:flex!important;align-items:center!important}
 body.v300-conversation .composer textarea{flex:1;min-width:0;min-height:42px!important;max-height:110px!important;padding:9px!important}body.v300-conversation .composer button,body.v300-conversation .attach-btn{min-width:40px!important;min-height:42px!important;padding:5px!important}
 body.v300-conversation #suggestBtn{display:none!important}body.v300-conversation .msg:not(.v318-photo-msg){padding:8px 10px!important;border-radius:14px!important;max-width:83%!important}body.v300-conversation .msg .meta{margin-top:3px!important}body.v300-conversation .date-separator{margin:8px auto!important}
 body.v300-conversation .msg-action-trigger{opacity:.75}body.v300-conversation .msg-actions{display:none!important}
 body.v300-conversation .q-thread-foot{display:none}#q317Actions{padding:6px!important;gap:4px!important}#q317Actions .summary{font-size:11px}
 #view-more .more-card{max-width:none!important}
}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}
#v300Trading[hidden]{display:none!important}
/* Never override access-gated or inactive UI. */
#view-more .more-card.hidden,#view-more .more-card[hidden],#appView.hidden{display:none!important}
/* V303 removes legacy outer trading-mode visibility rule. */
.v300-ask-row{display:flex;gap:7px;padding:8px;align-items:center}.v300-ask-row input{flex:1;min-width:0;padding:10px}.v300-q-response{padding:12px;white-space:pre-wrap;max-height:180px;overflow:auto}.v300-file-card{display:flex!important;gap:9px;align-items:center;text-align:left;min-height:54px;max-width:100%;white-space:normal;overflow-wrap:anywhere}.v300-file-card small{display:block;opacity:.8}.v300-file-card strong{display:block;font-size:13px}

/* V303: existing server-selected ASSIST visibility stays authoritative. */
#activeChat #assistBar.hidden,#activeGroup #groupAssistBar.hidden,#activeChat #suggestionCard.hidden,#activeGroup #groupSuggestionCard.hidden{display:none!important}
body.v300-conversation #assistBar:not(.hidden),body.v300-conversation #groupAssistBar:not(.hidden){display:flex!important;flex:0 0 auto;align-items:center;justify-content:flex-start;background:transparent;border:0;box-shadow:none;margin:0!important;padding:3px 10px!important;min-height:0}
body.v300-conversation #assistBar:not(.hidden)>span,body.v300-conversation #groupAssistBar:not(.hidden)>span{display:none!important}
body.v300-conversation #assistBarBtn,body.v300-conversation #groupSuggestBtn{font-size:12px;padding:6px 12px;min-height:36px;border-radius:20px}
body.v300-conversation .suggestion:not(.hidden){flex:0 0 auto;max-height:26dvh;overflow:auto;padding:8px 12px;margin:4px 8px;font-size:13px}
body.v300-conversation .suggestion-actions button{min-height:36px;padding:5px 10px}
/* Keep a keyboard/touch accessible message action, but reserve space so it cannot obscure text. */
#messageList .msg:not(.v318-photo-msg){position:relative;padding-inline-end:34px!important}
#messageList .msg:not(.v318-photo-msg)>.message-menu{position:absolute;inset-inline-end:5px;top:5px;width:23px;min-width:23px;padding:1px;opacity:.85}
#modal button[aria-label="Close"],#modal .modal-close,#modal #modalClose{color:var(--text,#25243a)!important}
/* V303_INSTALLED */

/* V304: wallet dashboard; preserve all existing payment controls. */
body:has(#view-q-economy.active) #globalQOrb,body:has(#view-q-creators.active) #globalQOrb,body:has(#view-professional-inbox.active) #globalQOrb{display:none!important}
#view-q-economy #q28Tab-creators{display:none!important}#view-q-economy .q28-hero{padding:14px!important;border-radius:16px!important;gap:9px!important;margin:0 0 8px}
#view-q-economy .q28-hero h2{font-size:20px;margin:3px 0}#view-q-economy .q28-hero p{font-size:12px;margin:3px 0}
#view-q-economy .q28-balance{padding:10px!important;min-width:0}#view-q-economy #q28Balance{font-size:26px!important}
#view-q-economy .q28-tabs{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin:10px 0}
#view-q-economy .q28-tabs button{min-width:0;min-height:44px;white-space:normal;font-size:12px;padding:8px!important}
#view-q-economy #q28Tab-wallet .grid.two{grid-template-columns:1fr}#view-q-economy #q28Tab-wallet .card{padding:12px;border-radius:14px}
#view-q-economy .v2136-q-switcher,#view-q-predict .v2136-q-switcher,#v2134MoreInbox{display:none!important}
/* V304_INSTALLED */

/* V305: mobile chat list is its own vertically scrollable region. */
@media(max-width:900px){
 body.v305-chat-list:not(.v300-conversation) #appView:not(.hidden){
  position:fixed!important;inset:0 0 auto 0!important;width:100%!important;
  height:var(--v300-vh,100dvh)!important;min-height:0!important;max-height:none!important;
  box-sizing:border-box!important;display:flex!important;flex-direction:column!important;
  padding:8px 8px max(8px,env(safe-area-inset-bottom,0px))!important;
  gap:6px!important;overflow:hidden!important;
 }
 body.v305-chat-list:not(.v300-conversation) #appView .workspace{
  order:0;display:flex!important;flex-direction:column!important;flex:1 1 0!important;
  min-height:0!important;min-width:0!important;height:auto!important;overflow:hidden!important;
 }
 body.v305-chat-list:not(.v300-conversation) #appView .topbar{flex:0 0 auto!important}
 body.v305-chat-list:not(.v300-conversation) #appView .sidebar{
  order:1;position:relative!important;inset:auto!important;flex:0 0 auto!important;
  width:100%!important;box-sizing:border-box!important;margin:0!important;
 }
 body.v305-chat-list:not(.v300-conversation) #view-chats.active,
 body.v305-chat-list:not(.v300-conversation) #view-chats.active .chat-layout:not(.open-chat),
 body.v305-chat-list:not(.v300-conversation) #view-chats.active .chat-layout:not(.open-chat) .conversation-list{
  display:flex!important;flex-direction:column!important;flex:1 1 0!important;
  height:auto!important;min-height:0!important;max-height:none!important;min-width:0!important;
  overflow:hidden!important;
 }
 body.v305-chat-list:not(.v300-conversation) #view-chats .chat-layout:not(.open-chat){gap:0!important}
 body.v305-chat-list:not(.v300-conversation) #view-chats .chat-layout:not(.open-chat) .chat-pane{display:none!important}
 body.v305-chat-list #view-chats .conversation-list > :not(#conversationList){flex:0 0 auto!important}
 body.v305-chat-list #view-chats #conversationList{
  flex:1 1 0!important;min-height:0!important;height:auto!important;max-height:none!important;
  overflow-y:auto!important;overflow-x:hidden!important;touch-action:pan-y;
  overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch;
  padding-bottom:76px!important;scroll-padding-bottom:76px;
 }
}
/* V305_INSTALLED */
