.mobile-forum-nav,.mobile-forum-home{display:none;}
@media(max-width:600px){
  .chat-header{height:54px;min-height:54px;overflow:visible;}
  .chat-header .header-left{flex:0 0 34px;max-width:34px;}
  .chat-header .header-info{display:none;}
  .chat-header .chat-header-center{flex:1;min-width:0;flex-direction:row !important;justify-content:center;gap:8px !important;}
  .chat-header .header-wordmark{font-size:14px;min-width:0;overflow:hidden;text-overflow:ellipsis;}
  .chat-header #desktopModeSwitch,.chat-header #motdBar{display:none !important;}
  .chat-header>div:last-child{max-width:none;flex-shrink:0;overflow:visible;}
  .mobile-forum-nav{display:inline-flex;align-items:center;justify-content:center;gap:6px;flex-shrink:0;min-height:34px;padding:7px 10px;border:1px solid var(--forum-blue);border-radius:2px;background:var(--forum-blue);color:#fff;font:800 13px 'DM Sans',sans-serif;cursor:pointer;}
  .mobile-forum-nav[aria-pressed="true"]{border-bottom:3px solid var(--forum-accent);}
  #onlinePanelWrap{position:absolute;right:0;top:0;bottom:0;width:176px;max-width:60vw;z-index:100;background:var(--surface);box-shadow:-8px 0 24px rgba(0,0,0,.22);}
  #onlinePanelWrap.collapsed{width:0;box-shadow:none;}
  #rightPanel{min-width:0;width:100%;}
  #rightPanelTabs,#onlinePanel,#desktopForumSectionsRail,#desktopForumStatsRail,#desktopForumToolsRail{display:none !important;}
  #forumPanel{display:flex !important;}
  #forumListView{padding:0;}
  #onlinePanelWrap .forum-browse-wrap{padding:10px !important;}
  #sidebarForumBtn{display:flex !important;justify-content:center;align-items:center;gap:7px;min-height:36px;padding:8px !important;border-radius:2px !important;background:var(--forum-blue) !important;font-size:13px !important;}
  #sidebarRecentThreadsHeading{display:block;padding:9px 10px !important;background:var(--card);border-block:1px solid var(--border);color:var(--text);font-size:12px;font-weight:800;letter-spacing:0;text-transform:none;}
  #forumList .forum-item{width:100% !important;padding:10px !important;margin:0;border-radius:0;}
  #forumList .forum-item-title{max-width:none !important;font-size:12px !important;overflow:hidden !important;overflow-wrap:anywhere;}
  #forumList .forum-item-meta{font-size:10px !important;}
  body.forum-mode #messages,body.forum-mode #desktopForumStage,body.forum-mode #chatComposerWrap,body.forum-mode #scrollBottomBtn,body.forum-mode #onlinePanelWrap,body.forum-mode #desktopForumFooter{display:none !important;}
  body.forum-mode .mobile-forum-home{display:block;}
  .mobile-forum-home{flex:1;min-width:0;min-height:0;height:100%;overflow-y:auto;overflow-x:hidden;background:var(--forum-panel);color:var(--forum-ink);font:14px/1.4 'DM Sans',sans-serif;touch-action:pan-y;-webkit-overflow-scrolling:touch;padding-bottom:env(safe-area-inset-bottom);}
  .mobile-forum-home [hidden]{display:none !important;}
  .mf-toolbar{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:10px 12px;border-bottom:1px solid var(--forum-line);}
  .mf-toolbar h1{font-size:16px;letter-spacing:-.03em;font-weight:800;}
  .mf-toolbar-actions{display:flex;gap:4px;}
  .mf-action{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:34px;border:1px solid var(--forum-line);border-radius:2px;padding:7px 9px;background:var(--forum-blue);color:#fff;font:700 11px 'DM Sans',sans-serif;cursor:pointer;}
  .mf-section{margin:0 0 16px;}
  .mf-section-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0;padding:10px 12px;background:var(--forum-panel-soft);border-block:1px solid var(--forum-line);font-size:14px;font-weight:600;list-style:none;}
  .mf-section-head::-webkit-details-marker{display:none;}
  summary.mf-section-head{cursor:pointer;}
  summary.mf-section-head::after{content:"";width:0;height:0;border:4px solid transparent;border-top-color:var(--forum-soft);transform:translateY(2px);}
  details:not([open])>summary.mf-section-head::after{transform:rotate(-90deg);}
  .mf-chat{margin:12px;border:1px solid var(--forum-line);}
  .mf-chat .mf-section-head{border:0;border-bottom:1px solid var(--forum-line);font-size:13px;font-weight:800;}
  .mf-live-title{display:flex;align-items:center;gap:7px;}
  .mf-live-dot{width:7px;height:7px;border-radius:50%;background:#22c55e;}
  .mf-read-only{font-size:10px;color:var(--forum-soft);font-weight:500;}
  .mf-chat-messages{height:180px;max-height:26vh;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;padding:6px 10px;touch-action:pan-y;}
  .mf-chat-line{display:flex;align-items:flex-start;gap:7px;padding:6px 0;border-bottom:1px solid var(--forum-line);font-size:12px;}
  .mf-chat-line:last-child{border:0;}
  .mf-chat-avatar{width:24px;height:24px;flex-shrink:0;overflow:hidden;border-radius:50%;display:flex;justify-content:center;align-items:center;background:var(--forum-panel-soft);}
  .mf-chat-avatar img,.mf-thread-avatar img{width:100%;height:100%;object-fit:cover;}
  .mf-chat-copy{min-width:0;flex:1;}
  .mf-chat-meta{display:flex;align-items:center;gap:7px;min-width:0;}
  .mf-chat-name{font-weight:800;max-width:65%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
  .mf-chat-time{color:var(--forum-soft);font-size:10px;flex-shrink:0;}
  .mf-chat-text{overflow-wrap:anywhere;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;}
  .mf-chat-attachment{display:flex;align-items:center;gap:6px;color:var(--forum-soft);font-size:11px;margin-top:3px;}
  .mf-chat-attachment img{width:42px;height:30px;object-fit:cover;border:1px solid var(--forum-line);}
  .mf-go-chat{width:100%;display:flex;justify-content:center;align-items:center;gap:8px;min-height:36px;border:0;border-top:1px solid var(--forum-line);border-radius:0;background:var(--forum-blue);color:#fff;font:800 12px 'DM Sans',sans-serif;cursor:pointer;}
  .mf-category-row{display:flex;align-items:center;width:100%;gap:12px;padding:17px 12px;background:none;border:0;border-bottom:1px solid var(--forum-line);border-radius:0;color:inherit;text-align:left;font:inherit;cursor:pointer;}
  .mf-category-icon{width:28px;flex-shrink:0;color:var(--forum-soft);}
  .mf-category-copy{min-width:0;flex:1;}
  .mf-category-title{font-size:15px;font-weight:800;overflow-wrap:anywhere;}
  .mf-category-counts{font-size:11px;margin-top:2px;}
  .mf-category-latest{font-size:12px;margin-top:8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
  .mf-category-age{font-size:11px;color:var(--forum-soft);}
  .mf-search{display:flex;align-items:center;gap:8px;padding:0 12px 12px;}
  .mf-search input{min-width:0;flex:1;padding:9px 10px;border:1px solid var(--forum-line);border-radius:2px;background:var(--forum-input);color:var(--forum-ink);font-size:13px !important;}
  .mf-filter{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 12px;border-top:1px solid var(--forum-line);}
  .mf-filter-label{font-size:12px;font-weight:700;}
  .mf-back{border:0;background:none;color:var(--forum-accent);font:700 12px 'DM Sans',sans-serif;cursor:pointer;min-height:30px;}
  .mf-thread-row{display:flex;align-items:flex-start;gap:9px;padding:12px;border-bottom:1px solid var(--forum-line);color:inherit;text-decoration:none;}
  .mf-thread-avatar{display:flex;align-items:center;justify-content:center;width:24px;height:24px;flex-shrink:0;overflow:hidden;border-radius:2px;background:var(--forum-panel-soft);font-size:12px;}
  .mf-thread-copy{min-width:0;flex:1;}
  .mf-thread-title{font-size:13px;line-height:1.4;overflow-wrap:anywhere;}
  .mf-tag{display:inline-block;color:#fff;padding:1px 5px;font-size:10px;line-height:1.4;font-weight:700;border-radius:3px;margin-right:5px;vertical-align:1px;}
  .mf-thread-meta{font-size:11px;color:var(--forum-soft);margin-top:3px;overflow-wrap:anywhere;}
  .mf-members{padding:12px;line-height:1.8;font-size:12px;}
  .mf-member{display:inline;border:0;padding:0;margin:0 6px 0 0;background:none;color:var(--forum-accent);font:inherit;cursor:pointer;overflow-wrap:anywhere;}
  .mf-online-total{display:block;color:var(--forum-soft);font-size:11px;margin-top:8px;}
  .mf-stats{display:grid;grid-template-columns:1fr minmax(0,55%);gap:4px 12px;padding:12px;font-size:12px;}
  .mf-stats dd{text-align:right;overflow-wrap:anywhere;}
  .mf-stats dt{color:var(--forum-soft);}
  .mf-empty{padding:20px 12px;color:var(--forum-soft);font-size:12px;}
  .mf-footer{display:flex;flex-direction:column;align-items:flex-start;gap:6px;padding:14px 12px 24px;background:var(--forum-panel-soft);border-top:1px solid var(--forum-line);}
  .mf-footer a,.mf-footer button{display:flex;align-items:center;gap:8px;color:var(--forum-ink);font:500 12px 'DM Sans',sans-serif;text-decoration:none;background:none;border:0;min-height:32px;padding:0;cursor:pointer;}
  .mf-footer .mf-footer-brand{margin-top:12px;color:var(--forum-soft);font-size:11px;}
  .mobile-forum-composer{position:fixed;inset:0;z-index:900;display:flex;background:var(--forum-panel);}
  .mobile-forum-composer>div{display:flex;flex:1;flex-direction:column;min-height:0;overflow:hidden;}
  .mobile-forum-composer>div>div:first-child{background:var(--forum-panel-soft) !important;border-color:var(--forum-line) !important;}
  .mobile-forum-composer>div>div:first-child *{color:var(--forum-ink) !important;}
  .mobile-forum-composer>div>div:last-child{padding:18px 14px !important;background:var(--forum-panel) !important;}
  .mobile-forum-home button:focus-visible,.mobile-forum-home a:focus-visible,.mobile-forum-nav:focus-visible{outline:2px solid var(--forum-accent);outline-offset:2px;}
}
@media(max-width:359px){
  .chat-header .header-wordmark{display:none;}
  .mf-toolbar h1{font-size:14px;}
  .mf-action{padding:7px;font-size:10px;}
}
