/* PrimChat v293: mobile-first dark default + global section/card coverage + performance */
:root{color-scheme:dark;--bg:#080d14;--card:#101823;--card2:#0d141d;--text:#edf3fb;--muted:#94a3b8;--line:#263445;--shadow:0 8px 24px rgba(0,0,0,.22)}
html,body{background:#080d14!important;color:#edf3fb!important;min-width:0;overflow-x:hidden}
body{background:linear-gradient(180deg,#080d14,#0b111a 55%,#080d14)!important}
body:before{display:none!important}
header,.topnav,.mobile-nav,footer,.chat-tools,.composer,.replybar,.users-panel,.chatbox,.card,.panel,.profile-card,.profile-panel,.profile-shell,.forum-card,.topic-list,.rules-card,.admin-card,.news-card,.announcement-card,.market-card,.market-item,.story-card,.post-card,.feed-card,.sn-card,.sn-wrap>section,.modal,.dropdown,.sidebar-section,.active-row,.topic-row,.forum-category,.profile-section-nav,.profile-tabs,.profile-stats,.settings-card,.notification-card,.friend-card,.user-card,form,fieldset,table,.table-wrap{background-color:#101823!important;color:#edf3fb!important;border-color:#263445!important}
header{background:rgba(10,16,24,.96)!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
a{color:#8fc4ff!important}.topnav a,.theme-btn,.quick-btn,.all-chat{color:#d7e3f2!important}.topnav a:hover,.theme-btn:hover,.quick-btn:hover{background:#172334!important}
input,textarea,select,.search{background:#0b131d!important;color:#edf3fb!important;border-color:#2a3a4e!important;box-shadow:none!important}
input::placeholder,textarea::placeholder{color:#718198!important}.secondary{background:#131d29!important;color:#dbe7f5!important;border-color:#304156!important}
button{touch-action:manipulation}.pinned-bar,.pinned-rules{background:#211b0c!important;color:#f6d98a!important;border-color:#6b5520!important}.error{background:#2a1115!important;color:#fecaca!important;border-color:#6f2730!important}.success{background:#0d2719!important;color:#bbf7d0!important;border-color:#245a38!important}
.profile-section-nav a,.profile-tabs a{color:#cbd8e8!important}.profile-section-nav a.active,.profile-tabs a.active{background:#1c3d63!important;color:#fff!important}
/* Every nested card inherits the dark surface instead of reverting to white. */
html body .card *,html body .panel *,html body .profile-card *,html body .profile-panel *,html body .forum-card *,html body .topic-list *,html body .admin-card *,html body .news-card *,html body .market-card *,html body .story-card *{max-width:100%}
/* Mobile performance: remove expensive effects and contain long sections. */
@media(max-width:800px){
 html{scroll-behavior:auto!important}
 header{position:sticky;top:0;padding:9px 10px!important}
 .brand{font-size:20px!important}.brand span,.brand em{display:none}
 .topnav{gap:2px!important;overflow-x:auto;flex-wrap:nowrap!important;justify-content:flex-start!important;scrollbar-width:none}.topnav::-webkit-scrollbar{display:none}.topnav a,.theme-btn{padding:8px 9px!important;font-size:12px!important;white-space:nowrap}
 main{width:100%!important;padding:12px 10px 76px!important}
 .hero,.page-head{padding:10px 2px 14px!important;gap:10px!important}.hero h1,.page-head h1{font-size:28px!important}
 .chat-layout,.forum-grid{grid-template-columns:1fr!important}.users-panel{min-height:0}.chatbox{min-height:0!important}.chat-tools{gap:6px!important}.chat-tools .chat-search{min-width:0!important}
 #messages,.messages{max-height:none!important;height:calc(100dvh - 250px);min-height:300px!important;padding:10px!important;contain:layout paint}
 .message-body,.msg-body{max-width:88%!important}.message,.msg{gap:6px!important}
 .card,.panel,.profile-card,.profile-panel,.forum-card,.topic-list,.rules-card,.admin-card{border-radius:16px!important;box-shadow:0 5px 18px rgba(0,0,0,.16)!important}
 .profile-content{padding:8px!important}.profile-panel{padding:13px!important}
 .mobile-nav{position:fixed;left:8px;right:8px;bottom:8px;z-index:9999;border:1px solid #263445!important;border-radius:16px!important;box-shadow:0 8px 24px rgba(0,0,0,.4)!important}
 img{content-visibility:auto}.chat-photo{content-visibility:auto}
}
@media(max-width:480px){
 .topnav a{font-size:11px!important;padding:7px!important}.brand{font-size:18px!important}
 .page-head h1,.hero h1{font-size:24px!important}.badges{gap:5px!important}.badges span,.online{padding:6px 9px!important}
 .forum-card,.topic-list,.profile-card,.profile-panel{padding:12px!important}
 .composer button{padding:10px!important}.composer textarea{font-size:16px!important}
}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}
