/* PrimChat v260 — global consistency layer */
html[data-site-theme="dark"],html[data-theme="dark"],body.dark,body.site-theme-dark{--bg:#070b14!important;--card:#0f172a!important;--card2:#111c2e!important;--text:#e7eef8!important;--muted:#94a3b8!important;--line:#263448!important;--brand:#60a5fa!important;--brand2:#818cf8!important;--shadow:0 18px 55px rgba(0,0,0,.30)!important;background:#070b14!important;color:var(--text)!important}
html[data-site-theme="dark"] body,html[data-theme="dark"] body,body.dark,body.site-theme-dark{background:radial-gradient(circle at 0 0,#172554,transparent 35%),#070b14!important;color:var(--text)!important}
html[data-site-theme="dark"] body:before,html[data-theme="dark"] body:before,body.dark:before{background:linear-gradient(rgba(96,165,250,.025) 1px,transparent 1px),linear-gradient(90deg,rgba(96,165,250,.025) 1px,transparent 1px)!important}
html[data-site-theme="dark"] header,html[data-theme="dark"] header,body.dark header{background:rgba(8,15,28,.94)!important;border-color:var(--line)!important;color:var(--text)!important}
html[data-site-theme="dark"] .brand,html[data-theme="dark"] .brand,body.dark .brand{color:var(--text)!important}
html[data-site-theme="dark"] .topnav a,html[data-site-theme="dark"] .theme-btn,html[data-theme="dark"] .topnav a,html[data-theme="dark"] .theme-btn,body.dark .topnav a,body.dark .theme-btn{color:#cbd5e1!important}
html[data-site-theme="dark"] .topnav a:hover,html[data-theme="dark"] .topnav a:hover,body.dark .topnav a:hover{background:#172033!important;color:#fff!important}
html[data-site-theme="dark"] .users-panel,html[data-site-theme="dark"] .chatbox,html[data-site-theme="dark"] .forum-card,html[data-site-theme="dark"] .topic-list,html[data-site-theme="dark"] .card,html[data-site-theme="dark"] .profile-card,html[data-site-theme="dark"] .admin-card,html[data-site-theme="dark"] .rules-card,html[data-site-theme="dark"] .sn-card,html[data-site-theme="dark"] .social-card,html[data-site-theme="dark"] .feed-card,html[data-site-theme="dark"] .market-card,html[data-site-theme="dark"] .news-card,html[data-site-theme="dark"] .profile-panel,html[data-site-theme="dark"] .city-card,html[data-site-theme="dark"] .group-card,html[data-theme="dark"] .users-panel,html[data-theme="dark"] .chatbox,html[data-theme="dark"] .forum-card,html[data-theme="dark"] .topic-list,html[data-theme="dark"] .card,html[data-theme="dark"] .profile-card,html[data-theme="dark"] .admin-card,html[data-theme="dark"] .rules-card,html[data-theme="dark"] .sn-card,html[data-theme="dark"] .social-card,html[data-theme="dark"] .feed-card,html[data-theme="dark"] .market-card,html[data-theme="dark"] .news-card,html[data-theme="dark"] .profile-panel,html[data-theme="dark"] .city-card,html[data-theme="dark"] .group-card,body.dark .users-panel,body.dark .chatbox,body.dark .forum-card,body.dark .topic-list,body.dark .card,body.dark .profile-card,body.dark .admin-card,body.dark .rules-card,body.dark .sn-card,body.dark .social-card,body.dark .feed-card,body.dark .market-card,body.dark .news-card,body.dark .profile-panel,body.dark .city-card,body.dark .group-card{background:var(--card)!important;color:var(--text)!important;border-color:var(--line)!important;box-shadow:var(--shadow)!important}
html[data-site-theme="dark"] .forum-category,html[data-site-theme="dark"] .topic-row,html[data-site-theme="dark"] .profile-mini,html[data-site-theme="dark"] .social-links a,html[data-site-theme="dark"] .secondary,html[data-site-theme="dark"] .search,html[data-theme="dark"] .forum-category,html[data-theme="dark"] .topic-row,html[data-theme="dark"] .profile-mini,html[data-theme="dark"] .social-links a,html[data-theme="dark"] .secondary,html[data-theme="dark"] .search,body.dark .forum-category,body.dark .topic-row,body.dark .profile-mini,body.dark .social-links a,body.dark .secondary,body.dark .search{background:var(--card2)!important;color:var(--text)!important;border-color:var(--line)!important}
html[data-site-theme="dark"] input,html[data-site-theme="dark"] textarea,html[data-site-theme="dark"] select,html[data-theme="dark"] input,html[data-theme="dark"] textarea,html[data-theme="dark"] select,body.dark input,body.dark textarea,body.dark select{background:#0b1320!important;color:var(--text)!important;border-color:var(--line)!important}
html[data-site-theme="dark"] input::placeholder,html[data-site-theme="dark"] textarea::placeholder,html[data-theme="dark"] input::placeholder,html[data-theme="dark"] textarea::placeholder,body.dark input::placeholder,body.dark textarea::placeholder{color:#71839a!important}
html[data-site-theme="dark"] .quick-btn,html[data-site-theme="dark"] .all-chat,html[data-theme="dark"] .quick-btn,html[data-theme="dark"] .all-chat,body.dark .quick-btn,body.dark .all-chat{color:#dbeafe!important}
html[data-site-theme="dark"] .quick-btn:hover,html[data-site-theme="dark"] .all-chat:hover,html[data-theme="dark"] .quick-btn:hover,html[data-theme="dark"] .all-chat:hover,body.dark .quick-btn:hover,body.dark .all-chat:hover{background:#172033!important}
html[data-site-theme="dark"] .mobile-nav,html[data-theme="dark"] .mobile-nav,body.dark .mobile-nav{background:rgba(8,15,28,.97)!important;border-color:var(--line)!important}
html[data-site-theme="dark"] .mobile-nav a,html[data-theme="dark"] .mobile-nav a,body.dark .mobile-nav a{color:#9aacbf!important}
html[data-site-theme="dark"] .mobile-nav a.active,html[data-theme="dark"] .mobile-nav a.active,body.dark .mobile-nav a.active{color:#60a5fa!important}
/* online popover */
.online-panel{display:none;position:fixed;z-index:20000;max-height:min(430px,70vh);overflow:auto;padding:10px;background:var(--card,#fff);color:var(--text,#0f172a);border:1px solid var(--line,#e2e8f0);border-radius:16px;box-shadow:0 20px 55px rgba(0,0,0,.28);box-sizing:border-box}
.online-panel[hidden]{display:none!important}.online-panel[data-open="1"]{display:block!important}.online-panel-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:4px 5px 9px;border-bottom:1px solid var(--line);margin-bottom:7px}.online-users{display:grid;gap:4px}.online-user-row{display:flex;align-items:center;gap:9px;padding:7px;border-radius:11px;color:inherit!important;text-decoration:none}.online-user-row:hover{background:var(--card2)}.online-mini-avatar{width:34px;height:34px;border-radius:50%;overflow:hidden;display:grid;place-items:center;background:var(--card2);flex:0 0 auto}.online-mini-avatar img{width:100%;height:100%;object-fit:cover}.online-avatar-fallback{display:grid;place-items:center;width:100%;height:100%}
/* navigation consistency */
.topnav{max-width:100%;overflow-x:auto;scrollbar-width:none;flex-wrap:nowrap!important}.topnav::-webkit-scrollbar{display:none}.topnav a,.topnav button{flex:0 0 auto}.mobile-nav{z-index:12000!important}
.mobile-nav a{overflow:visible!important}.mobile-nav .badge-count{z-index:2}
/* chat */
.chat-page .chatbox{min-height:calc(100dvh - 160px)!important}.chat-page #messages{min-height:0!important}.chat-page .chat-topline{position:relative!important;z-index:20!important}.chat-page .chat-topline .chat-search{min-width:0!important}.chat-page #messages .message{min-width:0!important}.chat-page #messages .chat-bubble{max-width:min(78%,700px)!important;box-sizing:border-box!important}.chat-page #messages .msg-hover-tools{position:static!important;transform:none!important;width:100%!important;max-width:100%!important;display:flex!important;flex-wrap:wrap!important;margin-top:6px!important;padding:0!important;border:0!important;background:transparent!important;box-shadow:none!important}.chat-page #messages .quick-reactions{position:static!important;display:flex!important;flex-wrap:wrap!important;max-width:100%!important;margin:0!important;padding:0!important;border:0!important;background:transparent!important;box-shadow:none!important}.chat-page #messages .msg-hover-tools button,.chat-page #messages .quick-reactions button{max-width:100%!important;flex:0 0 auto!important}
/* profile/message shortcuts */
.profile-modern .profile-head-actions,.profile-modern .profile-stats,.profile-modern .profile-panel,.profile-modern .profile-card{min-width:0!important;max-width:100%!important}.profile-modern .profile-panel{overflow:hidden!important}.profile-modern textarea{max-width:100%!important;overflow:auto!important}
/* badges */
.badge-count{font-variant-numeric:tabular-nums}.section-notify-badge{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 5px;border-radius:999px;background:#ef4444;color:#fff!important;font-size:10px;font-weight:900;line-height:1;margin-left:5px}
@media(max-width:700px){main{max-width:100%!important}.chat-page .chatbox{min-height:calc(100dvh - 120px)!important;height:calc(100dvh - 120px)!important}.chat-page #messages .chat-bubble{max-width:calc(100vw - 78px)!important}.chat-page .chat-topline{grid-template-columns:minmax(0,1fr) auto!important}.chat-page .chat-topline .online-slot{max-width:112px!important}.chat-page .chat-topline #onlineCount{max-width:112px!important;min-width:0!important;overflow:hidden;text-overflow:ellipsis}.online-panel{max-width:calc(100vw - 20px)!important}.profile-shell{padding-left:8px!important;padding-right:8px!important}.profile-modern .profile-card{border-radius:16px!important}.topnav{width:100%}}
@media(max-width:390px){.chat-page .chat-topline #onlineCount{max-width:92px!important;font-size:10px!important}.chat-page .chat-topline .chat-search input{font-size:12px!important}}

/* v261 GLOBAL DARK THEME — every visual page and every UI surface */
html.site-theme-dark,
html[data-site-theme="dark"],
html[data-theme="dark"]{
  color-scheme:dark!important;
  background:#070b14!important;
}
html.site-theme-dark body,
html[data-site-theme="dark"] body,
html[data-theme="dark"] body,
body.site-theme-dark,
body.dark{
  --pc-bg:#070b14;--pc-surface:#0f172a;--pc-surface-2:#111c2e;--pc-surface-3:#162238;
  --pc-text:#e8eef7;--pc-muted:#94a3b8;--pc-border:#29384d;--pc-link:#7dd3fc;
  background:#070b14!important;color:var(--pc-text)!important;
}
html.site-theme-dark body *{border-color:var(--pc-border)}
html.site-theme-dark body,
html.site-theme-dark main,
html.site-theme-dark section,
html.site-theme-dark article,
html.site-theme-dark aside,
html.site-theme-dark footer,
html.site-theme-dark nav,
html.site-theme-dark .page,
html.site-theme-dark .page-wrap,
html.site-theme-dark .container,
html.site-theme-dark .content,
html.site-theme-dark .content-wrap,
html.site-theme-dark .shell,
html.site-theme-dark .app,
html.site-theme-dark .app-shell,
html.site-theme-dark .layout,
html.site-theme-dark .page-shell,
html.site-theme-dark .site-main,
html.site-theme-dark .site-content,
html[data-site-theme="dark"] main,
html[data-site-theme="dark"] section,
html[data-site-theme="dark"] article,
html[data-site-theme="dark"] aside,
html[data-site-theme="dark"] footer,
html[data-site-theme="dark"] nav,
html[data-theme="dark"] main,
html[data-theme="dark"] section,
html[data-theme="dark"] article,
html[data-theme="dark"] aside,
html[data-theme="dark"] footer,
html[data-theme="dark"] nav{
  color:var(--pc-text)!important;
}
html.site-theme-dark .card,
html.site-theme-dark .panel,
html.site-theme-dark .box,
html.site-theme-dark .modal,
html.site-theme-dark .dialog,
html.site-theme-dark .dropdown,
html.site-theme-dark .popover,
html.site-theme-dark .menu,
html.site-theme-dark .list,
html.site-theme-dark .list-item,
html.site-theme-dark .item,
html.site-theme-dark .tile,
html.site-theme-dark .widget,
html.site-theme-dark .notice,
html.site-theme-dark .empty,
html.site-theme-dark .error,
html.site-theme-dark .success,
html.site-theme-dark .warning,
html.site-theme-dark .auth,
html.site-theme-dark .auth-card,
html.site-theme-dark .setup,
html.site-theme-dark .story-hub,
html.site-theme-dark .story-view,
html.site-theme-dark .story-settings,
html.site-theme-dark .story-create-box,
html.site-theme-dark .all-stories,
html.site-theme-dark .news-item,
html.site-theme-dark .announcement-card,
html.site-theme-dark .announcement-item,
html.site-theme-dark .market-item,
html.site-theme-dark .market-list,
html.site-theme-dark .friend-card,
html.site-theme-dark .friend-row,
html.site-theme-dark .user-card,
html.site-theme-dark .user-row,
html.site-theme-dark .conversation,
html.site-theme-dark .message-row,
html.site-theme-dark .notification-row,
html.site-theme-dark .settings-card,
html.site-theme-dark .admin-setting-grid,
html.site-theme-dark table{
  background:var(--pc-surface)!important;color:var(--pc-text)!important;border-color:var(--pc-border)!important;
}
html.site-theme-dark header,
html.site-theme-dark .header,
html.site-theme-dark .topbar,
html.site-theme-dark .top-nav,
html.site-theme-dark .sidebar,
html.site-theme-dark .left-sidebar,
html.site-theme-dark .right-sidebar,
html.site-theme-dark .mobile-nav,
html.site-theme-dark .bottom-nav{
  background:rgba(7,12,23,.97)!important;color:var(--pc-text)!important;border-color:var(--pc-border)!important;
}
html.site-theme-dark a:not(.primary):not(.danger){color:var(--pc-link)!important}
html.site-theme-dark h1,html.site-theme-dark h2,html.site-theme-dark h3,html.site-theme-dark h4,html.site-theme-dark h5,html.site-theme-dark h6,
html.site-theme-dark strong,html.site-theme-dark b,.site-theme-dark .title,.site-theme-dark .name{color:var(--pc-text)!important}
html.site-theme-dark p,html.site-theme-dark small,html.site-theme-dark label,html.site-theme-dark .muted,html.site-theme-dark .hint,html.site-theme-dark .description{color:var(--pc-muted)!important}
html.site-theme-dark input,
html.site-theme-dark textarea,
html.site-theme-dark select,
html.site-theme-dark option,
html.site-theme-dark button:not(.primary):not(.danger),
html.site-theme-dark .btn:not(.primary):not(.danger),
html.site-theme-dark .button:not(.primary):not(.danger){
  background:#0b1423!important;color:var(--pc-text)!important;border:1px solid var(--pc-border)!important;
}
html.site-theme-dark input:focus,html.site-theme-dark textarea:focus,html.site-theme-dark select:focus{border-color:#3b82f6!important;box-shadow:0 0 0 3px rgba(59,130,246,.15)!important}
html.site-theme-dark input::placeholder,html.site-theme-dark textarea::placeholder{color:#71839a!important}
html.site-theme-dark table th{background:#162238!important;color:#e8eef7!important}
html.site-theme-dark table td{background:#0f172a!important;color:#dbe5f2!important}
html.site-theme-dark hr{border-color:var(--pc-border)!important}
html.site-theme-dark pre,html.site-theme-dark code{background:#09111e!important;color:#dbeafe!important;border-color:var(--pc-border)!important}
html.site-theme-dark dialog{background:#0f172a!important;color:var(--pc-text)!important;border:1px solid var(--pc-border)!important}
html.site-theme-dark ::selection{background:#2563eb!important;color:#fff!important}
html.site-theme-dark .modal-backdrop,
html.site-theme-dark .overlay,
html.site-theme-dark .backdrop{background:rgba(0,0,0,.72)!important}
html.site-theme-dark .online-panel,
html.site-theme-dark .notification-panel,
html.site-theme-dark .friend-panel,
html.site-theme-dark .emoji-panel,
html.site-theme-dark .emoji-picker,
html.site-theme-dark .reaction-panel,
html.site-theme-dark .quick-menu,
html.site-theme-dark .context-menu{background:#0f172a!important;color:#e8eef7!important;border-color:#29384d!important}
html.site-theme-dark .chat-bubble{background:#162238!important;color:#e8eef7!important;border-color:#29384d!important}
html.site-theme-dark .chat-bubble.me{background:#173b68!important;color:#fff!important}
html.site-theme-dark .mobile-nav .badge-count,
html.site-theme-dark .section-notify-badge,
html.site-theme-dark .badge-count{background:#ef4444!important;color:#fff!important;border-color:transparent!important}
html.site-theme-dark img{background:#0b1423}
@media(max-width:700px){
  html.site-theme-dark .mobile-nav,html.site-theme-dark .bottom-nav{box-shadow:0 -10px 35px rgba(0,0,0,.35)!important}
  html.site-theme-dark .card,html.site-theme-dark .panel,html.site-theme-dark .modal{border-radius:14px!important}
}
