
:root{--bg:#f3f6fb;--card:#fff;--card2:#f8fafc;--text:#0f172a;--muted:#64748b;--line:#e2e8f0;--brand:#2563eb;--brand2:#4f46e5;--green:#16a34a;--red:#dc2626;--shadow:0 16px 50px rgba(15,23,42,.09);--r:24px}
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",Arial,sans-serif;color:var(--text);background:radial-gradient(circle at 10% 0,#dbeafe 0,transparent 30%),radial-gradient(circle at 90% 10%,#dcfce7 0,transparent 26%),var(--bg);line-height:1.5}
body:before{content:"";position:fixed;inset:0;pointer-events:none;background:linear-gradient(rgba(37,99,235,.025) 1px,transparent 1px),linear-gradient(90deg,rgba(37,99,235,.025) 1px,transparent 1px);background-size:32px 32px}
a{color:var(--brand);text-decoration:none}button,input,textarea,select{font:inherit}button{cursor:pointer}
header{position:sticky;top:0;z-index:100;display:flex;align-items:center;justify-content:space-between;gap:18px;padding:12px clamp(14px,4vw,42px);background:rgba(255,255,255,.82);backdrop-filter:blur(20px);border-bottom:1px solid rgba(226,232,240,.8)}
.brand{font-size:28px;font-weight:900;letter-spacing:-.05em}.brand span{font-weight:500;color:var(--muted)}.brand em{font-size:9px;font-style:normal;letter-spacing:.14em;text-transform:uppercase;color:var(--green);margin-left:7px}
.topnav{display:flex;align-items:center;gap:4px;flex-wrap:wrap;justify-content:flex-end}.topnav a,.theme-btn{border:0;background:transparent;color:#475569;padding:9px 11px;border-radius:12px;font-weight:750;font-size:14px}.topnav a:hover,.theme-btn:hover{background:#eef4ff;color:var(--brand)}
main{width:min(1260px,calc(100% - 28px));margin:auto;padding:24px 0 56px}.hero,.page-head{display:flex;align-items:flex-end;justify-content:space-between;gap:24px;padding:18px 2px 22px}.eyebrow{font-size:11px;font-weight:850;letter-spacing:.15em;text-transform:uppercase;color:var(--brand)}h1{font-size:clamp(30px,5vw,48px);line-height:1.05;letter-spacing:-.055em;margin:6px 0}.hero p,.page-head p{margin:0;color:var(--muted)}
.badges{display:flex;gap:8px;flex-wrap:wrap}.badges span,.online{background:rgba(255,255,255,.8);border:1px solid var(--line);padding:8px 12px;border-radius:999px;font-size:12px;font-weight:800;box-shadow:0 6px 20px rgba(15,23,42,.04)}
.chat-layout{display:grid;grid-template-columns:290px minmax(0,1fr);gap:16px}.users-panel,.chatbox,.forum-card,.topic-list,.card,.profile-card,.admin-card,.rules-card{background:rgba(255,255,255,.92);border:1px solid rgba(226,232,240,.9);border-radius:var(--r);box-shadow:var(--shadow)}
.users-panel{padding:16px;min-height:660px}.profile-mini{display:flex;gap:11px;align-items:center;padding:11px;background:var(--card2);border-radius:17px;margin-bottom:12px}.avatar{width:42px;height:42px;border-radius:50%;display:grid;place-items:center;overflow:hidden;background:linear-gradient(135deg,#dbeafe,#e0e7ff);font-weight:850;flex:0 0 auto}.avatar img{width:100%;height:100%;object-fit:cover}.avatar.big{width:64px;height:64px}
.search,input,textarea,select{width:100%;border:1px solid var(--line);background:#fff;color:var(--text);outline:0;border-radius:14px;padding:11px 13px;transition:.18s}.search:focus,input:focus,textarea:focus,select:focus{border-color:#93c5fd;box-shadow:0 0 0 4px rgba(37,99,235,.08)}
.side-title{font-size:10px;text-transform:uppercase;letter-spacing:.14em;color:#94a3b8;font-weight:850;margin:18px 5px 7px}.all-chat,.quick-btn{width:100%;border:0;border-radius:13px;text-align:left;padding:11px 12px;background:transparent;color:#334155;font-weight:700}.all-chat{background:#eff6ff;color:#1d4ed8}.quick-btn:hover{background:#f1f5f9}
.chatbox{display:flex;flex-direction:column;overflow:hidden;min-height:660px}.chat-tools{display:flex;gap:8px;align-items:center;padding:12px;border-bottom:1px solid var(--line);background:#fff}.chat-search{flex:1}.typing{height:24px;padding:3px 14px;color:var(--muted);font-size:12px}
#messages,.messages{flex:1;min-height:410px;max-height:60vh;overflow:auto;padding:18px}.message,.msg{display:flex;gap:10px;margin:9px 0;align-items:flex-end}.message.me,.msg.me{justify-content:flex-end}.message-body,.msg-body{max-width:min(76%,680px);padding:11px 14px;border:1px solid var(--line);border-radius:18px 18px 18px 6px;background:#fff;box-shadow:0 5px 18px rgba(15,23,42,.035)}.me .message-body,.me .msg-body{background:linear-gradient(135deg,var(--brand),var(--brand2));color:#fff;border-color:transparent;border-radius:18px 18px 6px 18px}.message-meta{font-size:11px;color:#94a3b8;margin-top:4px}.me .message-meta{color:rgba(255,255,255,.75)}
.composer{display:flex;gap:8px;padding:12px;border-top:1px solid var(--line);background:#fff}.composer textarea{min-height:46px;max-height:130px;resize:vertical}.composer button,.primary,.auth button{border:0;background:linear-gradient(135deg,var(--brand),var(--brand2));color:#fff;font-weight:800;padding:11px 17px;border-radius:14px;box-shadow:0 9px 24px rgba(37,99,235,.2)}.secondary{border:1px solid var(--line);background:#fff;color:#475569;padding:10px 14px;border-radius:13px;font-weight:750}
.emoji-panel{border:1px solid var(--line);background:#fff;border-radius:16px;padding:10px;box-shadow:var(--shadow);display:grid;grid-template-columns:repeat(8,1fr);gap:4px}.emoji-panel button{border:0;background:transparent;font-size:21px;border-radius:9px;padding:6px}.emoji-panel button:hover{background:#f1f5f9}
.forum-grid{display:grid;grid-template-columns:1.15fr .85fr;gap:16px}.forum-card,.topic-list,.rules-card,.profile-card,.admin-card{padding:20px}.forum-category{display:flex;align-items:center;gap:13px;padding:15px;border:1px solid var(--line);border-radius:18px;margin:9px 0;background:#fff;transition:.18s}.forum-category:hover,.topic-row:hover{border-color:#bfdbfe;transform:translateY(-1px);box-shadow:0 10px 28px rgba(15,23,42,.06)}.forum-icon,.topic-icon{width:46px;height:46px;display:grid;place-items:center;border-radius:15px;background:#eff6ff;font-size:21px}.topic-row{display:grid;grid-template-columns:auto 1fr auto;gap:12px;align-items:center;padding:13px;border:1px solid var(--line);border-radius:16px;margin:8px 0;background:#fff}.topic-main b{display:block}.topic-main small,.topic-last{color:var(--muted);font-size:12px}
.forum-actions{display:flex;gap:7px;flex-wrap:wrap}.tiny{border:0;background:transparent;color:var(--brand);font-size:12px;padding:3px 0;margin-right:7px}.danger-link{color:var(--red)}
.pinned-bar,.pinned-rules{padding:11px 15px;background:linear-gradient(90deg,#fffbeb,#fff7ed);border-bottom:1px solid #fde68a;color:#92400e}.pinned-rules{border:1px solid #fde68a;border-radius:16px;margin-bottom:16px}
.error{background:#fef2f2;color:#b91c1c;border:1px solid #fecaca;padding:10px 12px;border-radius:13px}.success{background:#f0fdf4;color:#15803d;border:1px solid #bbf7d0;padding:10px 12px;border-radius:13px}
.auth{min-height:100vh;display:grid;place-items:center;padding:24px;background:radial-gradient(circle at 20% 10%,#dbeafe,transparent 35%),radial-gradient(circle at 85% 90%,#dcfce7,transparent 30%),var(--bg)}.auth .card{width:min(470px,100%);padding:32px}.auth form{display:grid;gap:11px;margin-top:18px}.switch{text-align:center;color:var(--muted);margin-top:18px}
.social-links{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}.social-links a{display:inline-flex;align-items:center;gap:7px;padding:8px 11px;border:1px solid var(--line);border-radius:12px;background:var(--card2);font-weight:750;font-size:13px}.social-links a:hover{border-color:#93c5fd;background:#eff6ff}
.profile-hero{display:flex;align-items:center;gap:15px;padding:20px;border:1px solid var(--line);border-radius:20px;background:linear-gradient(135deg,#eff6ff,#f8fafc)}.profile-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.profile-grid .full{grid-column:1/-1}
@media(max-width:900px){.chat-layout,.forum-grid,.profile-grid{grid-template-columns:1fr}.users-panel{min-height:auto}.users-panel #users{max-height:260px;overflow:auto}.chatbox{min-height:620px}}
@media(max-width:640px){header{align-items:flex-start}.topnav a,.theme-btn{font-size:12px;padding:8px 7px}.brand em{display:none}main{width:calc(100% - 16px);padding-top:12px}.hero,.page-head{flex-direction:column;align-items:flex-start}.message-body,.msg-body{max-width:87%}#messages,.messages{max-height:none;min-height:390px;padding:12px}.composer{position:sticky;bottom:0}.emoji-panel{grid-template-columns:repeat(6,1fr)}.topic-row{grid-template-columns:auto 1fr}.topic-last{grid-column:2}}
body.dark{--bg:#070b14;--card:#0f172a;--card2:#111c2e;--text:#e7eef8;--muted:#94a3b8;--line:#263448;--shadow:0 18px 55px rgba(0,0,0,.3);background:radial-gradient(circle at 0 0,#172554,transparent 35%),#070b14}
body.dark header,.dark .chat-tools,.dark .composer{background:rgba(8,15,28,.9);border-color:var(--line)}body.dark .users-panel,.dark .chatbox,.dark .forum-card,.dark .topic-list,.dark .card,.dark .profile-card,.dark .admin-card,.dark .rules-card,.dark .message-body,.dark .msg-body,.dark .forum-category,.dark .topic-row,.dark input,.dark textarea,.dark select,.dark .secondary{background:#0f172a;color:var(--text);border-color:var(--line)}body.dark .profile-mini,.dark .all-chat{background:#111c2e}.dark .quick-btn,.dark .topnav a,.dark .theme-btn{color:#cbd5e1}.dark .quick-btn:hover,.dark .topnav a:hover{background:#172033}.dark .pinned-bar,.dark .pinned-rules{background:linear-gradient(90deg,#3a2b09,#251d0a);border-color:#73520b;color:#fde68a}.dark .social-links a{background:#111c2e;color:#dbeafe;border-color:var(--line)}
/* v25 personal profile redesign */
.profile-modern{background:var(--bg)}.profile-nav{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.profile-nav a{padding:9px 11px;border-radius:12px;text-decoration:none}.profile-shell{max-width:1180px;margin:24px auto 60px;padding:0 16px}.profile-modern .profile-card{overflow:hidden;padding:0}.profile-cover{height:190px;position:relative;background:radial-gradient(circle at 15% 20%,rgba(239,35,60,.38),transparent 34%),radial-gradient(circle at 80% 10%,rgba(217,4,41,.35),transparent 36%),linear-gradient(135deg,#111827,#3b0a16 55%,#d90429)}.cover-glow{position:absolute;inset:auto 10% -55px;height:110px;border-radius:50%;background:rgba(255,255,255,.12);filter:blur(30px)}.profile-head{display:grid;grid-template-columns:auto 1fr auto;gap:22px;padding:0 28px 24px;align-items:end;margin-top:-58px;position:relative}.avatar-wrap{position:relative}.profile-avatar-xl{width:132px;height:132px;border-radius:34px;overflow:hidden;border:6px solid var(--card);background:linear-gradient(135deg,#fee2e2,#ffe4e6);display:grid;place-items:center;font-size:48px;box-shadow:0 18px 45px rgba(0,0,0,.22)}.profile-avatar-xl img{width:100%;height:100%;object-fit:cover}.avatar-online{position:absolute;right:8px;bottom:8px;width:22px;height:22px;border:4px solid var(--card);border-radius:50%;background:#22c55e}.profile-title{padding-bottom:8px}.profile-name-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.profile-name-row h1{margin:0;font-size:31px}.profile-badge{font-size:12px;font-weight:800;padding:7px 10px;border-radius:999px;background:#fff1f2;color:#be123c}.profile-status-row{display:flex;gap:8px;align-items:center;color:var(--muted);font-size:13px;margin:7px 0 10px}.status i{display:inline-block;width:8px;height:8px;border-radius:50%;background:#94a3b8;margin-right:5px}.status.online i{background:#22c55e}.profile-title p{margin:0;color:var(--muted);line-height:1.55;max-width:720px}.profile-head-actions{display:flex;gap:8px;padding-bottom:8px}.profile-btn{border:0;border-radius:13px;padding:11px 15px;font-weight:800;cursor:pointer;transition:.18s;white-space:nowrap}.profile-btn:hover{transform:translateY(-1px)}.profile-btn.primary{background:linear-gradient(135deg,#d90429,#ef233c);color:white;box-shadow:0 9px 22px rgba(217,4,41,.22)}.profile-btn.secondary{background:var(--card2);color:var(--text);border:1px solid var(--line)}.profile-btn:disabled{opacity:.7;cursor:default}.profile-tabs{display:flex;gap:4px;padding:0 28px;border-top:1px solid var(--line);border-bottom:1px solid var(--line);overflow:auto}.profile-tabs a{padding:15px 13px;text-decoration:none;color:var(--muted);font-weight:750;white-space:nowrap;border-bottom:3px solid transparent}.profile-tabs a.active{color:var(--text);border-color:#d90429}.profile-content{display:grid;grid-template-columns:minmax(0,1fr) 310px;gap:16px;padding:18px}.profile-main-col{display:grid;gap:16px}.profile-panel{background:var(--card);border:1px solid var(--line);border-radius:20px;padding:20px}.panel-title h2{margin:3px 0 0;font-size:21px}.eyebrow{font-size:11px;font-weight:900;letter-spacing:.12em;color:#d90429}.profile-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:17px 0}.profile-stats div{padding:15px;border-radius:16px;background:var(--card2);border:1px solid var(--line)}.profile-stats b{display:block;font-size:23px}.profile-stats span{font-size:12px;color:var(--muted)}.contact-list{display:flex;flex-wrap:wrap;gap:8px}.contact-chip{display:inline-flex;align-items:center;padding:10px 12px;border-radius:13px;background:var(--card2);border:1px solid var(--line);text-decoration:none;color:var(--text);font-weight:700}.empty-contact{color:var(--muted);font-size:13px}.activity-list{display:grid;gap:8px;margin-top:15px}.activity-item{display:flex;align-items:center;gap:13px;padding:13px;border-radius:15px;background:var(--card2);border:1px solid var(--line)}.activity-item>span{font-size:22px}.activity-item b,.activity-item small{display:block}.activity-item small{color:var(--muted);margin-top:2px}.quick-panel a{display:flex;justify-content:space-between;gap:8px;padding:13px 0;border-bottom:1px solid var(--line);text-decoration:none;color:var(--text);font-weight:700}.quick-panel a:last-child{border-bottom:0}.quote-panel{background:linear-gradient(135deg,#fff1f2,#fff);}.quote-panel div{font-size:30px}.quote-panel b{display:block;margin:8px 0 4px}.quote-panel small{color:var(--muted);line-height:1.5}.edit-grid{display:grid;grid-template-columns:180px 1fr;gap:20px;margin-top:15px}.edit-avatar{display:flex;flex-direction:column;align-items:center;gap:8px}.profile-avatar-xl.small{width:120px;height:120px;border-radius:30px;font-size:40px}.text-danger{background:none;border:0;color:#dc2626;font-weight:700;cursor:pointer}.edit-fields label{display:block;font-size:12px;font-weight:800;margin-bottom:10px}.edit-fields textarea,.edit-fields input{margin-top:6px}.edit-fields textarea{min-height:110px}.edit-fields small{display:block;color:var(--muted);text-align:right}.edit-contact-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.edit-contact-grid .full{grid-column:1/-1}.save-state{margin-left:10px;color:#16a34a;font-weight:800}.profile-loading{padding:28px!important}.profile-skeleton{height:20px;border-radius:10px;background:linear-gradient(90deg,var(--card2),var(--line),var(--card2));margin:14px 0}.profile-skeleton.short{width:40%}.profile-error{padding:30px;text-align:center;color:#b91c1c}
body.dark .profile-cover{background:radial-gradient(circle at 15% 20%,rgba(239,35,60,.3),transparent 34%),linear-gradient(135deg,#020617,#24070d 60%,#7f1d1d)}body.dark .profile-badge{background:#3b1118;color:#fecdd3}body.dark .quote-panel{background:linear-gradient(135deg,#251016,#111827)}
@media(max-width:800px){.profile-shell{margin-top:10px;padding:0 8px}.profile-cover{height:145px}.profile-head{grid-template-columns:1fr;padding:0 16px 18px;gap:12px;margin-top:-48px}.profile-avatar-xl{width:104px;height:104px;border-radius:27px}.profile-name-row h1{font-size:25px}.profile-head-actions{padding:0;flex-wrap:wrap}.profile-head-actions .profile-btn{flex:1}.profile-content{grid-template-columns:1fr;padding:10px}.profile-tabs{padding:0 12px}.profile-panel{padding:16px;border-radius:17px}.profile-stats{gap:6px}.profile-stats div{padding:11px 8px}.profile-stats b{font-size:19px}.edit-grid{grid-template-columns:1fr}.edit-avatar{align-items:flex-start}.edit-contact-grid{grid-template-columns:1fr}.edit-contact-grid .full{grid-column:auto}.profile-nav{display:none}}
@media(max-width:480px){.profile-stats span{font-size:11px}.profile-stats b{font-size:17px}.contact-chip{width:100%}.profile-title p{font-size:13px}}

/* v26.1 — исправление наложения блоков форума и активных участников */
.sidebar-section{display:flex;flex-direction:column;gap:6px;margin:12px 0 18px;padding:12px;border:1px solid var(--line);border-radius:18px;background:rgba(248,250,252,.72);overflow:visible}
.sidebar-section .all-chat,.sidebar-section .quick-btn{display:flex;align-items:center;justify-content:flex-start;gap:8px;width:100%;min-width:0;min-height:42px;box-sizing:border-box;white-space:normal;overflow-wrap:anywhere}
.sidebar-section a.quick-btn{display:flex;text-decoration:none}
.side-tip{padding:4px 4px 2px;color:#94a3b8;font-size:10px;font-weight:850;letter-spacing:.12em;text-transform:uppercase}
.forum-grid{align-items:start;min-width:0}
.forum-grid>*{min-width:0}
.forum-card,.topic-list{min-width:0;overflow:hidden}
.forum-category{width:100%;min-width:0;box-sizing:border-box;text-align:left;overflow:hidden}
.forum-category>span:last-child{min-width:0;overflow:hidden}
.forum-category b,.forum-category small,.forum-category em{display:block;overflow-wrap:anywhere;word-break:break-word}
.active-list{display:grid;gap:10px;min-width:0}
.active-row{display:grid;grid-template-columns:auto auto minmax(0,1fr) auto;gap:12px;align-items:center;width:100%;min-width:0;box-sizing:border-box;padding:13px 15px;border:1px solid var(--line);border-radius:17px;background:var(--card);box-shadow:0 6px 20px rgba(15,23,42,.04);color:var(--text);overflow:hidden}
.active-row>*{min-width:0}
.active-name{overflow:hidden}.active-name b,.active-name small{display:block;overflow-wrap:anywhere;word-break:break-word}.active-stats{text-align:right;white-space:nowrap}.active-stats small{display:block;color:var(--muted);font-size:11px;overflow:hidden;text-overflow:ellipsis}
.active-avatar{width:42px;height:42px}
@media(max-width:900px){.active-row{grid-template-columns:auto auto minmax(0,1fr)}.active-stats{grid-column:2/-1;text-align:left}.active-stats small{white-space:normal}}
@media(max-width:640px){.sidebar-section{margin-top:10px;padding:10px}.sidebar-section .quick-btn,.sidebar-section .all-chat{min-height:44px;padding:10px}.active-row{grid-template-columns:auto auto minmax(0,1fr);gap:9px;padding:11px}.active-stats{grid-column:2/-1}.forum-grid{gap:12px}}
body.dark .sidebar-section{background:rgba(17,28,46,.72)}

/* v27 UI polish — chat + forum */
.forum-page,.active-page{overflow:visible}
.forum-grid{grid-template-columns:minmax(0,1fr) minmax(300px,.78fr);align-items:start;gap:20px}
.forum-grid>*{min-width:0}
.forum-card,.topic-list{min-width:0;overflow:hidden}
.forum-category{width:100%;min-width:0;text-align:left;display:grid;grid-template-columns:46px minmax(0,1fr) auto;align-items:center;gap:13px;cursor:pointer}
.forum-category>span:nth-child(2){min-width:0;display:flex;flex-direction:column;gap:2px}
.forum-category b,.forum-category small,.forum-category em{overflow-wrap:anywhere;word-break:break-word}
.forum-category em{font-style:normal;color:var(--muted);font-size:12px;margin-top:3px}
.forum-back{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:12px;margin-bottom:12px;padding:4px 2px}
.forum-back h2{margin:0;min-width:0;overflow-wrap:anywhere;font-size:22px}
.forum-back button{white-space:nowrap}
.topic-row{min-width:0;grid-template-columns:46px minmax(0,1fr) minmax(90px,160px)}
.topic-row>*{min-width:0}
.topic-main{overflow:hidden}.topic-main b{overflow-wrap:anywhere;word-break:break-word}.topic-main small{display:block;overflow-wrap:anywhere}.topic-last{text-align:right;overflow-wrap:anywhere}
.new-topic{margin-top:20px}
.new-topic textarea{min-height:150px;resize:vertical}
.active-page .page-head{align-items:center}
.active-list{display:grid;gap:10px;min-width:0}
.active-row{display:grid;grid-template-columns:36px 46px minmax(0,1fr) auto;align-items:center;gap:12px;padding:14px 16px;border:1px solid var(--line);border-radius:18px;background:var(--card);box-shadow:0 8px 26px rgba(15,23,42,.05);min-width:0;transition:.18s;color:var(--text)}
.active-row:hover{border-color:#bfdbfe;transform:translateY(-1px);box-shadow:0 12px 30px rgba(15,23,42,.08)}
.active-name,.active-stats{min-width:0}.active-name b,.active-name small,.active-stats b,.active-stats small{display:block;overflow-wrap:anywhere}.active-name small,.active-stats small{color:var(--muted);font-size:12px;margin-top:2px}.active-stats{text-align:right;color:var(--muted);font-size:12px}.active-stats b{font-size:18px;color:var(--text)}.rank{font-size:18px;text-align:center}.active-avatar{width:46px;height:46px}
/* Sidebar action links must stay separate and never overlap */
.users-panel .sidebar-section{display:grid;gap:7px;margin:14px 0 18px}
.users-panel .sidebar-section>*{min-width:0}
.users-panel .all-chat,.users-panel .quick-btn{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;min-height:42px;margin:0;text-decoration:none;line-height:1.25;white-space:normal;overflow-wrap:anywhere}
.users-panel .all-chat span{flex:0 0 auto}.users-panel .quick-btn{box-sizing:border-box}
.chat-layout>*{min-width:0}.chatbox{min-width:0}.chat-tools{flex-wrap:wrap}.chat-tools .chat-search{min-width:180px}.chat-tools>button{flex:0 0 auto;white-space:nowrap}
#messages,.messages{min-width:0;scrollbar-gutter:stable}.message,.msg{min-width:0}.message>div,.msg>div{min-width:0}.message p,.msg p{overflow-wrap:anywhere;word-break:break-word;white-space:pre-wrap;margin:7px 0 0}.msg-actions,.msg-actions button,.msg-actions>*{max-width:100%}.msg-actions{display:flex;flex-wrap:wrap;gap:4px;margin-top:7px}
.composer{align-items:flex-end}.composer textarea{min-width:0;flex:1}.composer button{flex:0 0 auto;white-space:nowrap}
.replybar{display:flex;align-items:center;gap:8px;padding:9px 12px;border-top:1px solid var(--line);background:var(--card2);min-width:0}.replybar #replytext{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chat-photo{display:block;max-width:min(100%,420px);max-height:420px;width:auto;height:auto;object-fit:contain;border-radius:14px;margin-top:8px}
@media(max-width:900px){
 .forum-grid{grid-template-columns:1fr;gap:14px}
 .forum-back{grid-template-columns:auto minmax(0,1fr);}
 .forum-back .primary{grid-column:1/-1;width:100%}
 .active-row{grid-template-columns:30px 42px minmax(0,1fr);gap:9px}.active-stats{grid-column:3;text-align:left}.active-stats small{display:block}
}
@media(max-width:640px){
 .forum-card,.topic-list{padding:14px}
 .forum-category{grid-template-columns:42px minmax(0,1fr) auto;padding:12px;gap:9px;border-radius:15px}
 .forum-icon,.topic-icon{width:42px;height:42px}
 .topic-row{grid-template-columns:42px minmax(0,1fr);gap:9px;padding:11px}
 .topic-last{grid-column:2;text-align:left;font-size:11px;padding-top:2px}
 .forum-back{gap:8px}.forum-back h2{font-size:18px}
 .chat-tools{padding:9px}.chat-tools .chat-search{order:10;flex-basis:100%;min-width:100%}
 .composer{padding:9px;gap:6px}.composer button{padding:10px 12px}.composer textarea{min-height:44px}
 .active-row{grid-template-columns:28px 42px minmax(0,1fr);padding:11px}.active-name b{font-size:14px}.active-stats b{font-size:16px}
}
body.dark .active-row{background:#0f172a;border-color:var(--line);box-shadow:none}
body.dark .replybar{background:#111c2e}

/* ===== v27.4 YOUTH CHAT UI ===== */
html,body{min-height:100%;background:#f4f6f8;color:#17202a}
html[data-theme="dark"],body.dark{background:#0b1016;color:#eef2f7}
html[data-theme="dark"] .chat-page,body.dark .chat-page{background:#0b1016!important;color:#eef2f7}
html[data-theme="dark"] header,body.dark header,
html[data-theme="dark"] .chatbox,body.dark .chatbox,
html[data-theme="dark"] .users-panel,body.dark .users-panel,
html[data-theme="dark"] .forum-card,body.dark .forum-card,
html[data-theme="dark"] .profile-panel,body.dark .profile-panel{background:#111923!important;color:#eef2f7!important;border-color:#253140!important}
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:#0c131c!important;color:#eef2f7!important;border-color:#2b3949!important}
.avatar,.avatar.big,.profile-avatar-xl img,.profile-avatar-xl .avatar,.post-user .avatar,.msg-head .avatar,.user-item .avatar{
 width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;
 border-radius:50%!important;object-fit:cover!important;object-position:center!important;display:block;overflow:hidden;
}
.avatar.big{width:64px!important;height:64px!important;min-width:64px!important;min-height:64px!important}
.profile-avatar-xl,.profile-avatar-xl img{border-radius:50%!important;overflow:hidden;object-fit:cover!important}
.v27-composer{position:relative;margin:10px 0 0}
.v27-composer-row{display:flex;gap:8px;align-items:flex-end;padding:8px;border:1px solid #dce2e8;border-radius:20px;background:#fff;box-shadow:0 6px 24px rgba(0,0,0,.08)}
body.dark .v27-composer-row{background:#101821;border-color:#2a3746;box-shadow:0 8px 30px rgba(0,0,0,.25)}
.v27-composer #text{flex:1;border:0!important;outline:0!important;resize:none;background:transparent!important;box-shadow:none!important;min-height:42px;padding:10px 8px;font-size:15px}
.v27-emoji-btn,.v27-send{border:0!important;width:42px;height:42px;border-radius:14px!important;display:grid;place-items:center;font-size:21px;cursor:pointer;flex:0 0 42px}
.v27-send{background:#d90429;color:#fff}
.v27-emoji-btn{background:#eef1f5;color:#343b45}
body.dark .v27-emoji-btn{background:#202b38;color:#fff}
.v27-emoji-panel{position:absolute;bottom:64px;right:0;z-index:50;width:min(360px,calc(100vw - 30px));max-height:290px;overflow:auto;padding:10px;grid-template-columns:repeat(8,1fr);gap:4px;border:1px solid #dce2e8;border-radius:18px;background:#fff;box-shadow:0 15px 45px rgba(0,0,0,.2)}
body.dark .v27-emoji-panel{background:#111923;border-color:#2b3949}
.v27-emoji{border:0;background:transparent;border-radius:9px;font-size:22px;padding:5px;cursor:pointer}
.v27-emoji:hover{background:#eef1f5}
body.dark .v27-emoji:hover{background:#202b38}
.msg-actions .reply-btn,.reaction{border:0!important;border-radius:9px!important;background:transparent!important;box-shadow:none!important;padding:5px 8px!important;font-size:13px!important}
.msg-actions .reply-btn:hover,.reaction:hover{background:rgba(127,127,127,.12)!important}
.topic-actions{display:flex;gap:8px;align-items:center}.topic-actions button,.post-actions button{border:0;border-radius:10px;padding:8px 10px;cursor:pointer;background:#eef1f5;color:#202631}
body.dark .topic-actions button,body.dark .post-actions button{background:#202b38;color:#fff}
.stat-link{display:flex;flex-direction:column;text-decoration:none;color:inherit}
.v27-people{max-width:1100px;margin:auto;padding:24px}.v27-people-head{display:flex;justify-content:space-between;gap:20px;align-items:center;flex-wrap:wrap}.v27-people-search{display:flex;gap:8px;width:min(500px,100%)}.v27-people-search input{flex:1;padding:13px;border-radius:13px}.v27-people-search button{border:0;border-radius:13px;padding:0 16px;background:#d90429;color:#fff}.v27-people #grid{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin-top:20px}.v27-person{display:grid;grid-template-columns:52px 1fr auto;gap:12px;align-items:center;padding:14px;border:1px solid #e1e5ea;border-radius:18px;background:#fff}.v27-person img{width:52px;height:52px;border-radius:50%;object-fit:cover}.v27-person small{display:block;color:#77808c}.v27-person a{text-decoration:none}
body.dark .v27-person{background:#111923;border-color:#253140;color:#eef2f7}
@media(max-width:700px){
 .chat-layout{display:block!important}.users-panel{display:none!important}.chatbox{width:100%!important;min-width:0!important}
 .chat-tools{gap:6px!important}.chat-tools button{padding:8px!important}
 #messages{padding:10px 6px!important}.message{max-width:92%!important}
 .v27-emoji-panel{right:4px;grid-template-columns:repeat(7,1fr)}
 .v27-people{padding:14px}.v27-people #grid{grid-template-columns:1fr}
 .v27-person{grid-template-columns:48px 1fr}.v27-person a{grid-column:2}
 .profile-head{display:flex!important;flex-direction:column!important;align-items:flex-start!important}
 .profile-head-actions{width:100%!important}.profile-head-actions>*{width:100%!important}
 .profile-avatar-xl,.profile-avatar-xl img{width:110px!important;height:110px!important}
}

/* v27.5 mobile/layout fixes */
.chat-tools{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.chat-tools .chat-search{flex:1 1 220px;min-width:160px}
.chat-tools>button{width:auto!important;min-width:44px;flex:0 0 auto!important;white-space:nowrap;box-sizing:border-box}
.v27-composer-row{width:100%;box-sizing:border-box}
.v27-composer-row textarea{min-width:0!important;width:auto!important}
.v27-emoji-panel{display:none;position:absolute}
.post-actions{display:flex!important;flex-wrap:wrap;gap:7px;margin-top:12px;padding-top:10px;border-top:1px solid var(--line)}
.post-actions button{display:inline-flex!important;align-items:center!important;justify-content:center!important;width:auto!important;min-width:0!important;flex:0 0 auto!important;white-space:nowrap!important}
.forum-compose-row{display:flex;align-items:flex-end;gap:8px;position:relative}
.forum-compose-row #postText{flex:1;min-width:0}
.thread-emoji-btn{width:44px!important;height:44px!important;flex:0 0 44px!important;border:0;border-radius:12px;background:var(--card2);cursor:pointer}
.thread-emoji-panel{position:relative;display:grid;grid-template-columns:repeat(8,1fr);gap:4px;margin-top:8px;padding:9px;border:1px solid var(--line);border-radius:14px;background:var(--card);max-height:210px;overflow:auto}
.thread-emoji-panel button{border:0;background:transparent;font-size:21px;padding:6px;border-radius:8px;cursor:pointer}
.thread-emoji-panel button:hover{background:rgba(127,127,127,.14)}
@media(max-width:640px){
 .chat-tools{gap:6px;padding:8px!important}
 .chat-tools .chat-search{flex:1 1 100%;min-width:100%;order:0}
 .chat-tools>button{flex:0 0 auto!important;width:auto!important;padding:8px 10px!important}
 .v27-composer-row{gap:5px;padding:6px}
 .v27-emoji-btn,.v27-send{width:40px!important;height:40px!important;flex:0 0 40px!important;padding:0!important}
 .v27-emoji-panel{width:min(330px,calc(100vw - 24px));right:0;bottom:58px}
 .forum-compose-row{align-items:flex-end}
 .forum-compose-row .primary{width:auto!important;flex:0 0 auto!important;padding:10px 12px!important}
 .thread-emoji-btn{width:40px!important;height:40px!important;flex-basis:40px!important}
 .thread-emoji-panel{grid-template-columns:repeat(6,1fr)}
 .post-actions button{padding:8px 10px!important;font-size:13px!important}
 .profile-content{display:block!important;padding:10px!important}
 .profile-main-col,.profile-side{display:grid!important;gap:12px!important}
 .profile-stats{grid-template-columns:repeat(3,minmax(0,1fr))!important}
 .profile-stats>*{min-width:0;overflow:hidden}
 .profile-stats span{display:block;white-space:normal}
 .profile-head-actions{display:flex!important;flex-direction:column!important;gap:8px!important}
 .profile-head-actions .profile-btn{width:100%!important;box-sizing:border-box}
 .profile-tabs{display:flex;gap:6px;overflow-x:auto;white-space:nowrap}
}

/* Мини-аватар рядом с ником в сообщениях общего чата */
.chat-userline{display:flex;align-items:center;gap:7px;min-width:0}
.chat-userline .avatar{width:30px;height:30px;min-width:30px;border-radius:50%;font-size:14px}
.chat-userline span{display:flex;flex-direction:column;min-width:0}
.chat-userline b{line-height:1.15;overflow-wrap:anywhere}
.chat-userline small{line-height:1.15;margin-top:2px}
@media(max-width:640px){
  .chat-userline .avatar{width:28px;height:28px;min-width:28px}
}

/* ===== Compact chat/forum controls + dark theme visibility ===== */
.chat-tools{background:var(--card,#fff)!important;}
.chat-tools>button.chat-tool-btn{width:38px!important;height:38px!important;min-width:38px!important;padding:0!important;display:inline-grid!important;place-items:center!important;border:1px solid #d7dde5!important;border-radius:11px!important;background:#f3f5f7!important;color:#17202a!important;font-size:18px!important;line-height:1!important;box-shadow:none!important;}
body.dark .chat-tools>button.chat-tool-btn,html[data-theme="dark"] .chat-tools>button.chat-tool-btn{background:#1b2633!important;color:#f4f7fb!important;border-color:#344354!important;}
body.dark .chat-tools>button.chat-tool-btn:hover,html[data-theme="dark"] .chat-tools>button.chat-tool-btn:hover{background:#273548!important;}
.chat-tools>button#clearBtn{width:auto!important;min-width:38px!important;height:38px!important;padding:0 10px!important;background:#f3f5f7!important;color:#17202a!important;border:1px solid #d7dde5!important;border-radius:11px!important;}
body.dark .chat-tools>button#clearBtn,html[data-theme="dark"] .chat-tools>button#clearBtn{background:#1b2633!important;color:#f4f7fb!important;border-color:#344354!important;}
.chat-tools .chat-search input{height:38px!important;box-sizing:border-box!important;border-radius:11px!important;}
.v27-composer-row{max-width:100%;gap:5px!important;padding:5px!important;border-radius:16px!important;}
.v27-composer #text{min-height:38px!important;padding:8px 7px!important;}
.v27-emoji-btn,.v27-send{width:38px!important;height:38px!important;flex-basis:38px!important;border-radius:11px!important;font-size:19px!important;}
.v27-emoji-panel{width:300px!important;max-width:calc(100vw - 20px)!important;max-height:230px!important;padding:7px!important;grid-template-columns:repeat(8,1fr)!important;border-radius:14px!important;}
.v27-emoji{font-size:20px!important;padding:4px!important;}
.forum-compose-row{position:relative!important;display:flex!important;align-items:flex-end!important;gap:6px!important;}
.forum-compose-row #postText{min-height:40px!important;}
.thread-emoji-btn{width:40px!important;height:40px!important;flex:0 0 40px!important;padding:0!important;background:#f1f4f7!important;color:#17202a!important;border:1px solid #d7dde5!important;}
body.dark .thread-emoji-btn,html[data-theme="dark"] .thread-emoji-btn{background:#1b2633!important;color:#fff!important;border-color:#344354!important;}
.forum-send-btn{height:40px!important;padding:0 12px!important;white-space:nowrap!important;}
.thread-emoji-panel{position:absolute!important;right:0!important;bottom:48px!important;z-index:100!important;width:290px!important;max-width:calc(100vw - 24px)!important;max-height:220px!important;display:grid!important;grid-template-columns:repeat(7,1fr)!important;gap:2px!important;margin:0!important;padding:7px!important;background:var(--card,#fff)!important;border:1px solid var(--line,#d7dde5)!important;border-radius:14px!important;box-shadow:0 16px 40px rgba(0,0,0,.22)!important;overflow:auto!important;}
.thread-emoji-panel[hidden]{display:none!important;}
body.dark .thread-emoji-panel,html[data-theme="dark"] .thread-emoji-panel{background:#111923!important;border-color:#344354!important;}
.thread-emoji-panel button{font-size:20px!important;padding:5px!important;}
.post-actions{align-items:center!important;}
@media(max-width:640px){
 .chat-tools{padding:6px!important;gap:5px!important;}
 .chat-tools .chat-search{flex:1 1 calc(100% - 90px)!important;min-width:0!important;}
 .chat-tools .chat-search input{width:100%!important;}
 .chat-tools>button.chat-tool-btn{width:36px!important;height:36px!important;min-width:36px!important;}
 .v27-composer-row{padding:4px!important;}
 .v27-emoji-panel{right:0!important;bottom:52px!important;width:285px!important;grid-template-columns:repeat(7,1fr)!important;}
 .forum-compose-row{display:grid!important;grid-template-columns:minmax(0,1fr) 40px auto!important;}
 .forum-compose-row #postText{grid-column:1/-1!important;width:100%!important;}
 .thread-emoji-btn{grid-column:2!important;grid-row:2!important;}
 .forum-send-btn{grid-column:3!important;grid-row:2!important;}
 .thread-emoji-panel{right:0!important;bottom:47px!important;width:275px!important;grid-template-columns:repeat(6,1fr)!important;}
}

/* ===== v28.1 final fixes ===== */
.admin-name{color:#e11d48!important;font-weight:900!important}
body.dark .admin-name,html[data-theme="dark"] .admin-name{color:#ff4d6d!important}
.chat-userline .admin-badge,.msg-head .admin-badge{color:#f59e0b}
.chat-userline .avatar img,.chat-userline img.avatar,.msg-head img.avatar{object-fit:cover!important}
.chat-tools{display:flex!important;align-items:center!important;gap:6px!important;flex-wrap:nowrap!important}
.chat-tools .chat-search{flex:1 1 auto!important;min-width:0!important}
.chat-tools .chat-search input{width:100%!important}
.v27-composer-row{max-width:100%!important}
.v27-emoji-panel{pointer-events:auto!important}
.thread-emoji-panel{pointer-events:auto!important}
@media(max-width:640px){
 .chat-tools{gap:5px!important}
 .chat-tools .chat-search{min-width:0!important}
 .chat-tools>button.chat-tool-btn{flex:0 0 36px!important}
 .v27-emoji-panel{width:270px!important;max-width:calc(100vw - 18px)!important}
 .thread-emoji-panel{width:270px!important;max-width:calc(100vw - 18px)!important}
}
.topic-compose{position:relative}
.topic-compose #topicText{width:100%;box-sizing:border-box;padding-right:52px}
.topic-compose .thread-emoji-btn{position:absolute;right:8px;bottom:8px;z-index:3}
.topic-compose .thread-emoji-panel{right:8px;bottom:55px}
.admin-name{color:#e11d48!important;font-weight:900!important}
body.dark .admin-name,html[data-theme="dark"] .admin-name{color:#ff4d6d!important}

/* ===== v28.2 visual + admin upgrades ===== */
.admin-name{color:#16a34a!important;font-weight:900!important}
body.dark .admin-name,html[data-theme="dark"] .admin-name{color:#4ade80!important}
.chat-bubble{max-width:min(88%,760px);padding:10px 12px;border:1px solid var(--line);border-radius:18px 18px 18px 6px;background:var(--card);box-shadow:0 5px 18px rgba(15,23,42,.05);min-width:0}
.me .chat-bubble{background:linear-gradient(135deg,var(--brand),var(--brand2));color:#fff;border-color:transparent;border-radius:18px 18px 6px 18px}
.chat-bubble p{overflow-wrap:anywhere;word-break:break-word;white-space:pre-wrap;margin:8px 0 0;line-height:1.45}
.chat-userline span,.msg-head span{min-width:0}.chat-userline b,.msg-head b{overflow-wrap:anywhere;word-break:break-word}.chat-userline small,.msg-head small{color:var(--muted);font-size:11px;display:block;white-space:nowrap}
.me .chat-userline small{color:rgba(255,255,255,.75)}
.msg-actions{position:relative;z-index:2}.msg-actions .reply-btn{color:inherit;border:1px solid transparent!important}.dark .msg-actions .reply-btn,body.dark .msg-actions .reply-btn{color:#e7eef8!important;border-color:#3b4a5c!important;background:#172230!important}.dark .msg-actions .reply-btn:hover,body.dark .msg-actions .reply-btn:hover{background:#223044!important}
.v27-composer-row{position:relative}.v27-emoji-panel{z-index:200!important;bottom:56px!important;right:0!important;background:var(--card)!important;color:var(--text)!important;border:1px solid var(--line)!important;box-shadow:0 16px 40px rgba(0,0,0,.25)!important}
.admin-setting-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.admin-setting-grid label{font-weight:800;font-size:12px}.admin-setting-grid input,.admin-setting-grid select{margin-top:6px}.admin-stats{display:grid;grid-template-columns:repeat(5,1fr);gap:10px}.admin-stats>div{padding:16px;border:1px solid var(--line);border-radius:16px;background:var(--card2)}.admin-stats b{display:block;font-size:24px}.admin-stats span{color:var(--muted);font-size:12px}.forum-admin-row{display:flex;justify-content:space-between;gap:12px}.forum-admin-row>div:first-child{min-width:0}.forum-admin-row b,.forum-admin-row small{display:block;overflow-wrap:anywhere}.template-red{--brand:#d90429;--brand2:#ef233c}.template-green{--brand:#15803d;--brand2:#22c55e}.template-purple{--brand:#7c3aed;--brand2:#a855f7}.template-dark{--brand:#38bdf8;--brand2:#6366f1}
.profile-name-row{align-items:center;display:flex;gap:10px;flex-wrap:wrap}.profile-status-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap;min-width:0}.profile-status-row .status{white-space:nowrap}.profile-badge{white-space:nowrap}
.v27-person img{width:46px;height:46px;min-width:46px;min-height:46px;object-fit:cover;border-radius:50%}
@media(max-width:700px){.admin-setting-grid{grid-template-columns:1fr}.admin-stats{grid-template-columns:repeat(2,1fr)}.forum-admin-row{display:block}.forum-admin-row .admin-buttons{margin-top:8px}.v27-person img{width:40px;height:40px;min-width:40px;min-height:40px}.v27-person{grid-template-columns:40px minmax(0,1fr)!important}.chat-bubble{max-width:94%}.chat-userline small,.msg-head small{font-size:10px}.msg-actions{gap:3px}}
.site-welcome,.site-ad{margin:0 0 12px;padding:13px 16px;border:1px solid var(--line);border-radius:16px;background:var(--card);box-shadow:var(--shadow);color:var(--text)}.site-welcome{font-weight:700}.site-ad{align-items:center;gap:10px;flex-wrap:wrap}.site-ad span{color:var(--muted)}.site-ad a{margin-left:auto;font-weight:800;color:var(--brand)}


/* ===== v30 PRO MAX — mobile redesign ===== */
html,body{max-width:100%;overflow-x:hidden}
header{min-width:0}
.brand{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.topnav{min-width:0;max-width:100%;overflow-x:auto;overflow-y:hidden;flex-wrap:nowrap;scrollbar-width:none}
.topnav::-webkit-scrollbar{display:none}
.topnav a,.topnav button{flex:0 0 auto}
.chat-layout{min-width:0}
.users-panel,.chatbox,.profile-card,.forum-card,.topic-list,.card,.admin-card{min-width:0}
.chatbox{overflow:hidden}
#messages{min-width:0;overflow-x:hidden}
.message{width:100%;min-width:0}
.message>.chat-bubble{min-width:0}
.message.me{justify-content:flex-end}
.message.me .chat-bubble,.message.mine .chat-bubble{background:linear-gradient(135deg,var(--brand),var(--brand2));color:#fff;border-color:transparent;border-radius:18px 18px 6px 18px}
.chat-userline,.msg-head{display:flex;align-items:center;gap:8px;min-width:0}
.chat-userline>span,.msg-head>span{display:flex;align-items:baseline;gap:6px;min-width:0;flex-wrap:wrap}
.chat-userline small,.msg-head small{display:inline-block;white-space:nowrap;flex:0 0 auto}
.chat-userline b,.msg-head b{min-width:0;overflow-wrap:anywhere}
.reactions{display:flex;flex-wrap:wrap;gap:4px;margin-top:7px}
.reactions .reaction{display:inline-flex!important;align-items:center;justify-content:center;min-width:38px!important;width:auto!important;height:34px!important;padding:4px 8px!important;border-radius:10px!important;background:var(--card2)!important;color:var(--text)!important;border:1px solid var(--line)!important;font-size:15px!important;line-height:1!important;box-shadow:none!important}
.reactions .reaction.active{border-color:var(--brand)!important;box-shadow:0 0 0 2px rgba(37,99,235,.12)!important}
.msg-actions{display:flex!important;flex-wrap:wrap!important;align-items:center!important;gap:5px!important;margin-top:7px!important}
.msg-actions .reply-btn{display:inline-flex!important;align-items:center!important;justify-content:center!important;width:auto!important;min-width:0!important;max-width:100%!important;min-height:34px!important;height:auto!important;padding:6px 9px!important;border-radius:10px!important;white-space:normal!important;line-height:1.15!important;font-size:12px!important}
.v27-composer{width:100%;box-sizing:border-box;padding:0 8px 8px}
.v27-composer-row{width:100%;min-width:0}
.v27-composer #text{min-width:0!important;max-width:none!important}
.v27-emoji-btn,.v27-send{flex:0 0 42px!important;width:42px!important;min-width:42px!important;height:42px!important}
.v27-emoji-panel{max-width:calc(100vw - 28px)!important;overflow:auto!important}

/* profile: never allow the avatar to escape its box */
.profile-avatar-xl{width:132px!important;height:132px!important;max-width:132px!important;max-height:132px!important;aspect-ratio:1/1!important;flex:0 0 132px!important}
.profile-avatar-xl img,.profile-avatar-xl>img,.profile-avatar-xl .avatar{display:block!important;width:100%!important;height:100%!important;max-width:100%!important;max-height:100%!important;object-fit:cover!important}
.profile-head{min-width:0}
.profile-title{min-width:0}
.profile-status-row{max-width:100%;line-height:1.4}
.profile-status-row .status,.profile-status-row .profile-badge{display:inline-flex;align-items:center;white-space:nowrap}

@media(max-width:900px){
 .chat-layout{display:flex!important;flex-direction:column!important;gap:10px}
 .chatbox{order:1;min-height:calc(100dvh - 110px)!important;height:auto!important}
 .users-panel{order:2;min-height:0!important}
 .users-panel #users{max-height:360px}
 #messages,.messages{min-height:52vh;max-height:none!important}
}
@media(max-width:640px){
 body{font-size:14px}
 header{position:sticky;top:0;padding:8px 10px;gap:8px;align-items:center;overflow:hidden}
 .brand{font-size:17px;max-width:38vw}
 .brand span{display:none}
 .topnav{gap:2px;justify-content:flex-start;flex:1}
 .topnav a,.theme-btn{font-size:12px!important;padding:7px 8px!important;white-space:nowrap}
 main{width:100%!important;padding:8px 7px 24px!important}
 .site-welcome,.site-ad,.pinned-rules{margin-bottom:8px;border-radius:14px;padding:10px 12px}
 .hero{padding:8px 5px 12px!important;gap:8px!important}
 .hero h1{font-size:29px!important}
 .hero p{font-size:13px}
 .badges{width:100%;gap:5px}
 .badges span{padding:6px 9px;font-size:11px}
 .chatbox{border-radius:18px!important;min-height:calc(100dvh - 115px)!important}
 .chat-tools{padding:7px!important;gap:5px!important}
 .chat-tools .chat-search{min-width:0!important;flex:1 1 auto!important}
 .chat-tools .chat-search input{font-size:13px!important;height:38px!important;padding:8px 10px!important}
 .chat-tools>button.chat-tool-btn{flex:0 0 36px!important;width:36px!important;height:36px!important}
 #messages{padding:9px 7px 6px!important;min-height:55dvh!important}
 .message{margin:7px 0!important;gap:5px!important}
 .chat-bubble{max-width:calc(100% - 4px)!important;width:auto!important;padding:9px 10px!important;border-radius:15px 15px 15px 5px!important}
 .chat-userline .avatar,.msg-head .avatar{width:28px!important;height:28px!important;min-width:28px!important;flex:0 0 28px!important}
 .chat-userline>span,.msg-head>span{gap:4px!important}
 .chat-userline small,.msg-head small{font-size:10px!important}
 .chat-bubble p{font-size:14px!important;line-height:1.4!important;margin:6px 0 0!important}
 .reactions{gap:3px!important}
 .reactions .reaction{min-width:34px!important;height:32px!important;padding:3px 6px!important;font-size:14px!important}
 .msg-actions{gap:4px!important}
 .msg-actions .reply-btn{min-height:32px!important;padding:5px 7px!important;font-size:11px!important}
 .v27-composer{padding:0 5px 5px!important}
 .v27-composer-row{gap:4px!important;padding:4px!important;border-radius:14px!important}
 .v27-composer #text{font-size:14px!important;min-height:40px!important;padding:9px 6px!important}
 .v27-emoji-btn,.v27-send{width:42px!important;min-width:42px!important;height:42px!important;font-size:18px!important}
 .v27-emoji-panel{width:280px!important;right:0!important;bottom:54px!important;grid-template-columns:repeat(7,1fr)!important}
 .replybar{margin:0 5px!important;max-width:calc(100% - 10px)!important;overflow:hidden}
 .replybar span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 .users-panel{padding:10px!important;border-radius:18px!important}
 .profile-mini{padding:8px!important}
 .profile-mini .avatar.big{width:48px!important;height:48px!important;min-width:48px!important}
 .user-item{min-width:0!important}
 .user-item .avatar{width:38px!important;height:38px!important;min-width:38px!important;max-width:38px!important}
 .user-btn{min-width:0!important;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 .profile-shell{padding:0!important;margin:0!important}
 .profile-cover{height:110px!important}
 .profile-head{display:flex!important;flex-direction:column!important;align-items:flex-start!important;padding:0 12px 14px!important;gap:9px!important;margin-top:-35px!important}
 .profile-avatar-xl{width:82px!important;height:82px!important;max-width:82px!important;max-height:82px!important;flex-basis:82px!important;border-width:4px!important;border-radius:20px!important;font-size:30px!important}
 .avatar-online{width:17px!important;height:17px!important;border-width:3px!important;right:2px!important;bottom:2px!important}
 .profile-name-row{gap:6px!important}
 .profile-name-row h1{font-size:22px!important;max-width:100%;overflow-wrap:anywhere}
 .profile-badge{font-size:10px!important;padding:5px 7px!important}
 .profile-status-row{font-size:11px!important;gap:5px!important;flex-wrap:wrap!important}
 .profile-title p{font-size:12px!important;line-height:1.45!important}
 .profile-head-actions{width:100%!important;display:grid!important;grid-template-columns:1fr 1fr!important;gap:6px!important}
 .profile-head-actions .profile-btn{width:100%!important;padding:9px 7px!important;font-size:12px!important;min-width:0!important}
 .profile-tabs{padding:0 7px!important;overflow-x:auto!important}
 .profile-tabs a{padding:11px 9px!important;font-size:12px!important}
 .profile-content{padding:7px!important;gap:7px!important}
 .profile-panel{padding:12px!important;border-radius:15px!important}
 .profile-stats div{min-width:0!important}
 .profile-stats b{font-size:17px!important}
 .profile-stats span{font-size:10px!important}
}

/* compact mobile admin */
@media(max-width:640px){
 .admin-pro-tabs{overflow-x:auto!important;flex-wrap:nowrap!important;position:sticky!important;top:48px!important}
 .protab{flex:0 0 auto!important}
 .pro-form{grid-template-columns:1fr!important}
 .admin-stats{grid-template-columns:repeat(2,minmax(0,1fr))!important}
 .admin-row{flex-direction:column!important;align-items:stretch!important}
 .admin-buttons{display:flex!important;flex-wrap:wrap!important;gap:5px!important}
 .admin-buttons button{flex:1 1 auto!important;min-width:90px!important}
}
.site-logo{width:30px;height:30px;object-fit:cover;border-radius:9px;vertical-align:middle;margin-right:6px;flex:0 0 30px}.brand{display:flex;align-items:center}
@media(max-width:640px){.site-logo{width:24px;height:24px;flex-basis:24px;border-radius:7px;margin-right:4px}}

/* ===== v32 PRO MAX community/mobile polish ===== */
.admin-name{color:#16a34a!important;font-weight:900!important}
body.dark .admin-name,html[data-theme="dark"] .admin-name{color:#4ade80!important}
.chat-bubble{box-sizing:border-box;min-width:0;overflow:hidden;overflow-wrap:anywhere;word-break:break-word}
.chat-bubble p{overflow-wrap:anywhere;word-break:break-word;white-space:pre-wrap}
.chat-userline>span,.msg-head>span{min-width:0;overflow:hidden}
.chat-userline b,.msg-head b{overflow-wrap:anywhere;word-break:break-word}
.mobile-nav{display:none}
.market-tools{display:flex;gap:8px;align-items:center;margin-bottom:14px}.market-tools input{flex:1;min-width:0}.market-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.market-card{background:var(--card);border:1px solid var(--line);border-radius:20px;overflow:hidden;box-shadow:var(--shadow)}.market-photo{height:150px;display:flex;align-items:center;justify-content:center;background:var(--card2);font-size:50px}.market-photo img{width:100%;height:100%;object-fit:cover}.market-card-body{padding:14px}.market-cat{font-size:11px;color:var(--muted);font-weight:800}.market-card h3{margin:5px 0 7px}.market-price{font-size:20px}.market-card p{color:var(--muted);min-height:45px}.market-contact{display:block;text-align:center;margin-top:10px}.market-form textarea{width:100%;min-height:120px;box-sizing:border-box;margin:10px 0}.news-list{display:grid;gap:12px}.news-card{display:flex;gap:14px;padding:18px;background:var(--card);border:1px solid var(--line);border-radius:18px;box-shadow:var(--shadow)}.news-card.pinned{border-color:var(--brand)}.news-icon{font-size:28px}.news-card h2{margin:0 0 7px}.news-card p{white-space:pre-wrap;overflow-wrap:anywhere}.notification-item{display:flex;gap:12px;padding:14px;border-bottom:1px solid var(--line)}.notification-item:last-child{border-bottom:0}.notification-item.unread{background:color-mix(in srgb,var(--brand) 8%,transparent)}.notification-icon{font-size:24px}.notification-item p{margin:4px 0}.notification-item small{color:var(--muted)}
@media(max-width:900px){.market-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:640px){
 body{padding-bottom:66px}.mobile-nav{position:fixed;display:flex;left:0;right:0;bottom:0;height:60px;background:var(--card);border-top:1px solid var(--line);z-index:9998;box-shadow:0 -8px 25px rgba(0,0,0,.08);padding-bottom:env(safe-area-inset-bottom)}.mobile-nav a{flex:1;min-width:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;color:var(--muted);font-size:20px;text-decoration:none}.mobile-nav a span{font-size:9px;font-weight:800}.mobile-nav a.active{color:var(--brand)}
 .market-tools{display:grid;grid-template-columns:1fr auto;gap:7px}.market-tools input{grid-column:1/-1;width:100%}.market-grid{grid-template-columns:1fr;gap:10px}.market-photo{height:120px}.market-card{border-radius:16px}.market-card-body{padding:12px}.news-card{padding:13px;border-radius:15px}.news-card h2{font-size:18px}.news-card p{font-size:14px}.page-head{gap:10px}.page-head button{width:100%}
 .admin-pro-tabs{top:0!important}.pro-form textarea{min-height:110px}.chatbox{margin-bottom:5px}.chat-bubble{max-width:100%!important}.reactions .reaction{font-size:13px!important;min-width:32px!important}.msg-actions .reply-btn{font-size:11px!important}
}


/* v33 PRO MAX mobile/chat/profile fixes */
.reply-preview{display:block;margin:7px 0 8px;padding:8px 10px;border-left:3px solid var(--brand,#2563eb);border-radius:9px;background:rgba(127,127,127,.10);font-size:12px;line-height:1.35;min-width:0;overflow:hidden}.reply-preview span{display:block;color:var(--muted);font-size:10px}.reply-preview b{display:block;overflow-wrap:anywhere}.reply-preview p{margin:2px 0 0!important;font-size:12px!important;line-height:1.3!important;opacity:.85;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.me .reply-preview{border-left-color:rgba(255,255,255,.7);background:rgba(255,255,255,.12)}
.admin-name{color:#16a34a!important;font-weight:800}.me .admin-name{color:#86efac!important}.moderator{color:#2563eb}
.people-back{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:12px}.people-back a{display:inline-flex;padding:9px 12px;border-radius:11px;background:var(--card,#fff);border:1px solid var(--line,#ddd);text-decoration:none;color:inherit}.people-profile-btn{display:inline-flex;align-items:center;justify-content:center;white-space:nowrap;text-decoration:none;border:1px solid var(--line,#ddd);background:var(--card,#fff);color:inherit;padding:8px 10px;border-radius:10px;font-weight:700}.friend-row{display:grid;grid-template-columns:44px minmax(0,1fr) auto auto;gap:10px;align-items:center;padding:11px 0;border-bottom:1px solid var(--line)}.friend-row .avatar{width:44px;height:44px;min-width:44px;border-radius:50%;object-fit:cover}.friend-row small{display:block;color:var(--muted)}
@media(max-width:640px){
 body{overflow-x:hidden}.chat-page main{width:100%;box-sizing:border-box}.chat-layout{width:100%!important}.chatbox{width:100%!important;max-width:100%!important;box-sizing:border-box;overflow:visible!important}.v27-composer{position:relative!important;z-index:50!important}.v27-composer-row{display:grid!important;grid-template-columns:minmax(0,1fr) 42px 42px!important;gap:5px!important;align-items:end!important}.v27-composer-row textarea{min-width:0!important;width:100%!important;box-sizing:border-box!important}.v27-emoji-btn,.v27-send{width:42px!important;height:42px!important;min-width:42px!important}.v27-emoji-panel{position:absolute!important;right:4px!important;bottom:50px!important;z-index:9999!important;width:min(290px,calc(100vw - 18px))!important;max-height:235px!important;overflow:auto!important;display:none;grid-template-columns:repeat(7,1fr)!important;background:var(--card,#fff)!important;box-shadow:0 18px 50px rgba(0,0,0,.28)!important}.v27-emoji-panel[style*="display: grid"]{display:grid!important}.message{width:100%!important;min-width:0!important}.chat-bubble{max-width:calc(100% - 2px)!important;min-width:0!important;box-sizing:border-box!important}.chat-userline>span,.msg-head>span{min-width:0!important}.chat-userline b,.msg-head b{overflow-wrap:anywhere!important;word-break:break-word!important}.msg-actions{display:flex!important;flex-wrap:wrap!important}.reply-btn{white-space:nowrap!important}.reply-preview{max-width:100%!important}.profile-status-row{align-items:flex-start!important}.profile-status-row .status{max-width:100%!important}.profile-head-actions{grid-template-columns:1fr!important}.profile-stats{gap:4px!important}.profile-stats a,.profile-stats div{min-width:0!important}.v27-person{grid-template-columns:40px minmax(0,1fr) auto!important}.v27-person>a{font-size:11px!important;padding:7px!important}.friend-row{grid-template-columns:40px minmax(0,1fr) auto!important}.friend-row .avatar{width:40px;height:40px;min-width:40px}.friend-row button{grid-column:3}.people-profile-btn{font-size:11px;padding:7px}.people-back{margin:8px 0}.topnav{max-width:100%;overflow-x:auto;white-space:nowrap}.topnav a{flex:0 0 auto}.profile-nav{overflow-x:auto;white-space:nowrap}.profile-nav a{flex:0 0 auto}
}

.forum-unread-badge{display:inline-flex;vertical-align:middle;align-items:center;justify-content:center;min-width:22px;height:22px;padding:0 6px;border-radius:999px;background:#d90429;color:#fff;font-size:11px;font-weight:900}.chatbox{overflow:visible!important}#messages{overflow:auto;min-height:0}.v27-composer{z-index:100}.v27-emoji-panel{z-index:9999!important}.reply-preview{box-sizing:border-box}.people-profile-btn{overflow:hidden;text-overflow:ellipsis}

/* ===== v34 visual fixes ===== */
.admin-name{color:var(--admin-text-color,#2563eb)!important;font-weight:900!important}
body.dark .admin-name,html[data-theme="dark"] .admin-name{color:var(--admin-text-color,#60a5fa)!important}
.message.admin-message .chat-bubble p{color:inherit!important;font-weight:700!important}
.message.admin-message .chat-bubble .reply-preview p{color:var(--muted)!important;font-weight:400!important}
.badges{display:flex!important;gap:10px!important;align-items:center!important;flex-wrap:wrap!important}
#onlineCount,#notify{display:inline-flex!important;align-items:center!important;justify-content:center!important;min-height:34px!important;padding:7px 12px!important;border-radius:999px!important;background:var(--card)!important;border:2px solid var(--line)!important;box-shadow:0 5px 18px rgba(0,0,0,.10)!important;color:var(--text)!important;font-weight:900!important;font-size:14px!important;white-space:nowrap!important}
#onlineCount{border-color:#22c55e!important;color:#15803d!important}
#notify{border-color:#ef4444!important;color:#b91c1c!important}
.composer-photo-btn{flex:0 0 42px!important;width:42px!important;min-width:42px!important;height:42px!important;border:0!important;border-radius:12px!important;background:var(--card2)!important;color:var(--text)!important;font-size:20px!important;cursor:pointer!important}
.composer-photo-btn:hover{transform:translateY(-1px);box-shadow:0 5px 14px rgba(0,0,0,.12)}
.v27-composer-row{grid-template-columns:minmax(0,1fr) 42px 42px 42px!important}
.quick-btn{display:flex!important;align-items:center!important;justify-content:flex-start!important;gap:7px!important}
@media(max-width:700px){#onlineCount,#notify{min-height:30px!important;padding:5px 9px!important;font-size:12px!important}.badges{gap:5px!important}.v27-composer-row{grid-template-columns:minmax(0,1fr) 40px 40px 40px!important}.composer-photo-btn,.v27-emoji-btn,.v27-send{width:40px!important;min-width:40px!important;height:40px!important}}

/* v35 admin/sidebar/DM improvements */
.admin-name{color:#16a34a!important;font-weight:900!important}.me .admin-name{color:#16a34a!important}
.admin-message p,.admin-message .chat-bubble p{color:inherit!important}
#onlineCount,#notify{font-size:16px!important;min-width:92px!important}
.visitor-item{margin:3px 0}.visitor-item .user-btn{font-size:13px}
.dm-action{border:1px solid var(--line);background:var(--card);color:var(--text);border-radius:10px;padding:7px 10px;font-weight:800;cursor:pointer}.voice-msg{display:flex;align-items:center;gap:8px;margin:8px 0}.voice-msg audio{max-width:260px;height:38px}.call-box{position:fixed;right:18px;bottom:18px;z-index:9999;display:flex;gap:15px;align-items:center;background:var(--card);border:2px solid #22c55e;border-radius:18px;padding:14px 16px;box-shadow:0 12px 35px rgba(0,0,0,.22)}.call-box>div{display:flex;flex-direction:column;gap:3px}.call-box button{border:0;border-radius:10px;padding:9px 12px;cursor:pointer}.call-box span{font-size:12px;opacity:.7}
@media(max-width:700px){.call-box{left:10px;right:10px;bottom:70px;justify-content:space-between}.voice-msg audio{max-width:210px}.dm-action{font-size:12px;padding:6px 8px}}
/* v36 UI fixes */
.admin-pro-tabs{position:relative!important;z-index:1000!important;pointer-events:auto!important;isolation:isolate!important}
.admin-pro-tabs .protab{position:relative!important;z-index:1001!important;pointer-events:auto!important;touch-action:manipulation!important;cursor:pointer!important}
.quick-emoji-btn{min-width:34px!important;padding:5px 8px!important}
body.dark .friend-row,body.dark .people-profile-btn{color:var(--text)!important;background:#111923!important;border-color:#344354!important}
body.dark .friend-row small{color:#9fb0c3!important}
@media(max-width:700px){
 .chatbox{height:calc(100dvh - 105px)!important;min-height:0!important;display:flex!important;flex-direction:column!important}
 #messages{flex:1 1 auto!important;height:auto!important;min-height:0!important;max-height:none!important;overflow-y:auto!important;padding:8px 6px 10px!important}
 .message{margin:5px 0!important}
 .chat-bubble{padding:7px 9px!important}
 .chat-bubble p{margin:4px 0 0!important;line-height:1.3!important}
 .reactions{margin-top:4px!important}
 .msg-actions{margin-top:4px!important}
}

/* ===== v36.1 final polish ===== */
:root{--admin-text-color:#2563eb}
.admin-name{color:var(--admin-text-color)!important;font-weight:700!important}
/* Telegram-like compact one-screen chat */
.chat-page main{height:calc(100dvh - 72px);min-height:0;display:flex;flex-direction:column;box-sizing:border-box}
.chat-page .hero{padding:8px 14px;margin:0 0 8px;min-height:52px;flex:0 0 auto}
.chat-page .hero h1{font-size:20px;margin:0}.chat-page .hero p{margin:2px 0;font-size:12px}
.chat-page .chat-layout{flex:1 1 auto;min-height:0}.chat-page .chatbox{height:100%;min-height:0!important}
.chat-page #messages{min-height:0!important;max-height:none!important;flex:1 1 auto;overflow-y:auto}
.chat-bubble{position:relative}
.msg-hover-tools{position:absolute;right:8px;top:-42px;display:flex;align-items:center;gap:3px;padding:3px 4px!important;background:transparent!important;border:0!important;box-shadow:none!important;opacity:0;visibility:hidden;transform:translateY(4px);transition:.15s;z-index:30;white-space:nowrap}
.message:hover .msg-hover-tools,.message:focus-within .msg-hover-tools{opacity:1;visibility:visible;transform:translateY(0)}
.quick-reactions{display:flex;gap:1px;background:transparent!important;border:0!important;box-shadow:none!important}
.msg-hover-tools button,.msg-hover-tools .reaction{background:transparent!important;border:0!important;box-shadow:none!important;color:inherit!important;border-radius:8px!important;padding:5px 6px!important;min-width:28px!important;height:30px!important;cursor:pointer}
.msg-hover-tools button:hover,.msg-hover-tools .reaction:hover,.msg-hover-tools .reaction.active{background:rgba(127,127,127,.10)!important}
.msg-actions{display:none!important}
.reactions{display:none!important}
@media(max-width:900px){.msg-hover-tools{position:relative;right:auto;top:auto;opacity:1;visibility:visible;transform:none;margin-top:3px;justify-content:flex-start;padding:0!important}.chat-page main{height:calc(100dvh - 58px)}.chat-page .hero{padding:6px 10px}.chat-page .hero h1{font-size:18px}.chat-page .hero p{display:none}}
/* remove heavy popup backgrounds */
.v27-emoji-panel,.thread-emoji-panel{background:transparent!important;border:0!important;box-shadow:none!important;backdrop-filter:none!important}
.v27-emoji-panel .v27-emoji,.thread-emoji-panel button{background:transparent!important;border:0!important;box-shadow:none!important}
.v27-emoji-panel .v27-emoji:hover,.thread-emoji-panel button:hover{background:rgba(127,127,127,.10)!important}
/* compact profile */
.profile-head{gap:16px}.profile-avatar-xl{box-shadow:0 8px 24px rgba(15,23,42,.12)}.profile-panel{border-radius:18px}.profile-stats{grid-template-columns:repeat(4,minmax(0,1fr))}
@media(max-width:700px){.profile-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.profile-title h1{font-size:24px}.profile-panel{padding:14px}}

/* v36 MAX performance + Telegram chat polish */
.chat-page main{min-height:0!important}
.chat-page .chat-layout{height:calc(100dvh - 78px)!important;min-height:0!important}
.chat-page .chatbox{height:100%!important;min-height:0!important}
.chat-page #messages{flex:1 1 auto;min-height:0!important;overflow-y:auto!important;overscroll-behavior:contain;padding-bottom:8px!important}
.msg-hover-tools{pointer-events:none!important}
.message:hover .msg-hover-tools,.message:focus-within .msg-hover-tools{pointer-events:auto!important}
.msg-hover-tools .quick-reactions,.msg-hover-tools button{pointer-events:auto!important}
.msg-hover-tools{max-width:calc(100% - 12px)!important;overflow-x:auto!important;scrollbar-width:none!important}
.msg-hover-tools::-webkit-scrollbar{display:none}
.v27-composer-row .v27-emoji-btn,.v27-composer-row .composer-photo-btn,.v27-composer-row .v27-send{flex:0 0 40px!important}
.v27-composer-row .composer-photo-btn{order:2!important}
.v27-composer-row .v27-emoji-btn{order:1!important}
.v27-composer-row .v27-send{order:3!important}
.v27-composer #text{order:0!important}
@media(max-width:900px){.chat-page .chat-layout{height:calc(100dvh - 62px)!important}.msg-hover-tools{position:sticky!important;top:auto!important;right:auto!important;opacity:1!important;visibility:visible!important;transform:none!important}.chat-page .users-panel{display:none!important}}

/* v34.1 emoji/chat reliability */
.v27-composer{position:relative}
.v27-composer-row{display:flex;align-items:flex-end;gap:6px}
.v27-composer-row textarea{flex:1;min-width:0;resize:none}
.v27-emoji-btn,.v27-send,.chat-tool-btn{flex:0 0 40px!important;width:40px!important;height:40px!important;min-width:40px!important;padding:0!important;display:inline-grid!important;place-items:center!important;border-radius:12px!important}
.v27-emoji-panel{position:absolute!important;z-index:1000;right:8px;bottom:58px;width:min(360px,calc(100vw - 24px));max-height:280px;overflow:auto;padding:9px;grid-template-columns:repeat(8,minmax(0,1fr));gap:4px;border:1px solid var(--line);border-radius:16px;background:var(--card);box-shadow:0 18px 50px rgba(0,0,0,.28)}
.v27-emoji-panel .emoji-item{width:35px!important;height:35px!important;padding:0!important;border:0!important;background:transparent!important;border-radius:9px!important;font-size:22px!important;display:grid!important;place-items:center!important;cursor:pointer}
.v27-emoji-panel .emoji-item:hover{background:var(--card2)!important}
.users-list{max-height:260px;overflow:auto;margin:8px 0}
.user-item{min-width:0}
.user-btn{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media(max-width:640px){
 .v27-composer-row{gap:4px}
 .v27-emoji-btn,.v27-send,.chat-tool-btn{flex-basis:38px!important;width:38px!important;height:38px!important;min-width:38px!important}
 .v27-emoji-panel{right:4px;bottom:54px;width:calc(100vw - 24px);grid-template-columns:repeat(7,minmax(0,1fr));max-height:250px}
 .v27-emoji-panel .emoji-item{width:34px!important;height:34px!important;font-size:21px!important}
}

/* ===== v36.2 interaction fixes ===== */
.v27-emoji-panel{pointer-events:auto!important;touch-action:manipulation!important}
.v27-emoji-panel .emoji-item{pointer-events:auto!important;touch-action:manipulation!important}
.msg-hover-tools,.msg-hover-tools *{touch-action:manipulation!important}
@media(max-width:900px){
  .msg-hover-tools{display:flex!important;pointer-events:auto!important}
  .msg-hover-tools .quick-reactions{display:flex!important}
  .msg-hover-tools .reply-btn,.msg-hover-tools .reaction{display:inline-flex!important;align-items:center!important;justify-content:center!important}
}

.market-hint{margin:-10px 0 12px;color:var(--muted);font-size:13px;font-weight:700}
@media(max-width:700px){
 .market-tools{display:grid!important;grid-template-columns:1fr 1fr!important;gap:8px!important}
 .market-tools input{grid-column:1/-1!important}
 .market-tools button{width:100%!important}
 .market-card-body{min-width:0!important}
 .market-card-body h3{overflow-wrap:anywhere!important}
 .profile-head-actions{width:100%!important}
 .profile-head-actions .profile-btn{width:100%!important}
}


/* v38 mobile usability + chat actions */
:root{--admin-text-color:#2563eb}
.quick-reactions{display:none!important;align-items:center;gap:2px!important}
.quick-reactions.open{display:flex!important}
.quick-emoji-launch{display:inline-flex!important;align-items:center;justify-content:center}
.msg-hover-tools{position:relative!important;inset:auto!important;opacity:1!important;visibility:visible!important;transform:none!important;display:flex!important;pointer-events:auto!important;gap:3px!important;margin-top:5px!important;padding:2px 0!important;background:transparent!important;border:0!important;box-shadow:none!important;overflow:visible!important}
.msg-hover-tools .reply-btn,.msg-hover-tools .reaction{display:inline-flex!important;align-items:center;justify-content:center!important;min-width:30px!important;height:30px!important;padding:4px 7px!important;background:var(--card2)!important;border:1px solid var(--line)!important;color:var(--text)!important;border-radius:9px!important}
.msg-hover-tools .reaction{background:transparent!important;border-color:transparent!important;font-size:18px!important}
.msg-hover-tools .reaction:hover,.msg-hover-tools .reaction.active{background:var(--card2)!important;border-color:var(--line)!important}
.chat-page #messages{scrollbar-gutter:stable;}
.chat-page .message{contain:layout paint;}
.chat-page .chat-bubble p{overflow-wrap:anywhere;word-break:break-word}

@media(max-width:900px){
 body{padding-bottom:70px!important}
 header{position:sticky!important;top:0!important;z-index:100!important;padding:7px 9px!important;gap:8px!important;background:var(--card)!important;backdrop-filter:blur(12px)}
 header .brand{flex:0 0 auto}.topnav{flex:1;overflow-x:auto!important;scrollbar-width:none!important;justify-content:flex-start!important;flex-wrap:nowrap!important}
 .chat-page main{height:calc(100dvh - 68px)!important;padding:0!important;width:100%!important}
 .chat-page .hero{padding:7px 10px!important;margin:0!important;min-height:44px!important}
 .chat-page .badges{display:flex!important;align-items:center!important}
 .chat-page .chat-layout{height:calc(100dvh - 118px)!important;display:flex!important;gap:0!important}
 .chat-page .chatbox{height:100%!important;border-radius:0!important;border-left:0!important;border-right:0!important;display:flex!important;flex-direction:column!important}
 .chat-page .chat-tools{padding:6px 8px!important;min-height:42px!important;gap:5px!important;flex-wrap:nowrap!important}
 .chat-page .chat-search{flex:1!important;min-width:0!important}.chat-page .chat-search input{width:100%!important}
 .chat-page #messages{padding:7px 7px 5px!important;flex:1 1 auto!important;min-height:0!important;max-height:none!important;overflow-y:auto!important}
 .chat-page .message{margin:4px 0!important}
 .chat-page .chat-bubble{padding:7px 8px!important;border-radius:14px!important}
 .chat-page .chat-userline,.chat-page .msg-head{gap:7px!important}.chat-page .chat-userline .avatar,.chat-page .msg-head .avatar{width:32px!important;height:32px!important;min-width:32px!important}
 .chat-page .chat-userline small,.chat-page .msg-head small{font-size:10px!important}
 .chat-page .chat-bubble p{font-size:14px!important;line-height:1.3!important}
 .chat-page .v27-composer{padding:6px 7px!important;background:var(--card)!important;border-top:1px solid var(--line)!important;position:relative!important;z-index:200!important}
 .chat-page .v27-composer-row{display:grid!important;grid-template-columns:minmax(0,1fr) 38px 38px 38px!important;gap:4px!important}
 .chat-page .v27-composer-row textarea{min-height:38px!important;max-height:92px!important;padding:9px 10px!important}
 .chat-page .v27-emoji-btn,.chat-page .composer-photo-btn,.chat-page .v27-send{width:38px!important;height:38px!important;min-width:38px!important}
 .chat-page .v27-emoji-panel{right:4px!important;bottom:52px!important;width:min(330px,calc(100vw - 16px))!important;max-height:240px!important;grid-template-columns:repeat(7,minmax(0,1fr))!important;padding:7px!important;z-index:10000!important}
 .chat-page .v27-emoji-panel .emoji-item{width:36px!important;height:36px!important;font-size:22px!important}
 .msg-hover-tools{flex-wrap:wrap!important}
 .quick-reactions.open{display:flex!important;flex-wrap:wrap!important}
 .quick-reactions.open .reaction{display:inline-flex!important}
 .mobile-nav{height:62px!important}
 .mobile-nav a{font-size:19px!important}.mobile-nav a span{font-size:9px!important}
}

/* Profile mobile cleanup */
@media(max-width:700px){
 .profile-cover{height:125px!important}
 .profile-head{padding:0 12px 14px!important;margin-top:-42px!important;gap:8px!important}
 .profile-avatar-xl{width:88px!important;height:88px!important;border-width:4px!important;border-radius:23px!important;font-size:34px!important}
 .profile-name-row h1{font-size:22px!important;overflow-wrap:anywhere}
 .profile-status-row{font-size:11px!important;flex-wrap:wrap!important}
 .profile-title p{font-size:12px!important;line-height:1.4!important}
 .profile-head-actions{display:grid!important;grid-template-columns:1fr 1fr!important;width:100%!important;gap:6px!important}
 .profile-head-actions .profile-btn{width:100%!important;padding:9px 6px!important;font-size:12px!important}
 .profile-content{padding:8px!important;gap:9px!important}
 .profile-panel{padding:13px!important;border-radius:15px!important}
 .profile-tabs{padding:0 7px!important}
 .profile-tabs a{padding:11px 10px!important;font-size:12px!important}
 .profile-stats{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:6px!important;margin:11px 0!important}
 .profile-stats div{padding:10px!important}.profile-stats b{font-size:18px!important}
}

/* Market mobile + search usability */
.market-tools{position:sticky;top:62px;z-index:20;background:var(--card)!important;backdrop-filter:blur(12px)}
.market-tools input,.market-tools select,.market-tools button{min-height:42px}
.market-card{transition:transform .16s ease,box-shadow .16s ease}.market-card:hover{transform:translateY(-2px)}
@media(max-width:700px){
 .market-tools{position:sticky!important;top:54px!important;grid-template-columns:1fr 1fr!important;padding:9px!important;border-radius:16px!important}
 .market-tools input:first-child{grid-column:1/-1!important}
 .market-tools button{min-height:42px!important}
 .market-grid{gap:10px!important;grid-template-columns:1fr!important}
 .market-photo{height:210px!important}.market-card-body{padding:12px!important}.market-card h3{font-size:16px!important}
 .market-actions{display:grid!important;grid-template-columns:1fr 1fr!important}.market-actions button{min-height:40px!important}.market-actions .primary{grid-column:1/-1!important}
 .market-tabs button{min-height:40px!important}
 .market-form{padding:13px!important}.market-form-grid{gap:8px!important}
}

/* v39 chat interaction fixes */
.message .msg-hover-tools{opacity:0;pointer-events:none;transform:translateY(4px);transition:.16s}.message:hover .msg-hover-tools,.message.tools-open .msg-hover-tools{opacity:1;pointer-events:auto;transform:none}.quick-reactions{display:flex;gap:4px;flex-wrap:wrap}.msg-hover-tools{display:flex;align-items:center;gap:5px;flex-wrap:wrap;margin-top:7px}.msg-hover-tools .reply-btn,.reaction{min-height:34px}.market-tabs{background:var(--card);padding:7px;border:1px solid var(--line);border-radius:16px}.market-tabs button{font-weight:800;min-height:42px}.market-tabs button.active{background:var(--brand);color:#fff;border-color:var(--brand)}@media(max-width:700px){.market-tabs{position:sticky;top:6px;z-index:10;display:grid;grid-template-columns:repeat(3,1fr);overflow:visible}.market-tabs button{padding:8px 6px;font-size:12px}.message .msg-hover-tools{display:none}.message.tools-open .msg-hover-tools{display:flex}.message .chat-bubble{cursor:pointer}.msg-actions{display:flex!important;flex-wrap:wrap;gap:5px}.profile-stats{grid-template-columns:repeat(2,1fr)}.profile-head-actions{width:100%;flex-wrap:wrap}.profile-head-actions .profile-btn{flex:1}.activity-item{align-items:flex-start}}


/* v40 final fixes */
:root{--admin-text-color:#2563eb}
.admin-name{color:var(--admin-text-color,#2563eb)!important;font-weight:800!important}
body.dark .admin-name,html[data-theme="dark"] .admin-name{color:var(--admin-text-color,#60a5fa)!important}

/* Chat reaction bar: always usable on desktop hover, tap-to-open on touch */
.message{position:relative}
.message .chat-bubble{position:relative}
.message .msg-hover-tools{display:flex!important;align-items:center;gap:6px;flex-wrap:wrap;margin-top:8px;padding:6px 8px;border:1px solid var(--line);border-radius:14px;background:var(--card2);box-shadow:0 8px 24px rgba(0,0,0,.12);opacity:0;visibility:hidden;pointer-events:none;transform:translateY(6px);transition:opacity .15s ease,transform .15s ease,visibility .15s ease;position:relative;z-index:20}
.message:hover .msg-hover-tools,.message:focus-within .msg-hover-tools,.message.tools-open .msg-hover-tools{opacity:1;visibility:visible;pointer-events:auto;transform:none}
.quick-reactions{display:flex;gap:4px;flex-wrap:wrap}
.quick-reactions .reaction{min-width:38px;min-height:34px;padding:5px 8px!important;border:1px solid var(--line)!important;background:var(--card)!important;color:var(--text)!important;border-radius:10px!important;cursor:pointer!important}
.quick-reactions .reaction:hover{background:var(--brand)!important;color:#fff!important}
.msg-hover-tools .reply-btn{min-height:34px!important;padding:6px 9px!important;border:1px solid var(--line)!important;background:var(--card)!important;color:var(--text)!important;border-radius:10px!important;cursor:pointer!important}

/* Market tabs readable on dark theme */
.market-tabs{background:var(--card)!important;border-color:var(--line)!important}
.market-tabs button{color:var(--text)!important;background:var(--card2)!important;border-color:var(--line)!important}
.market-tabs button.active{color:#fff!important;background:var(--brand)!important;border-color:var(--brand)!important}
.market-tools-title{grid-column:1/-1;font-weight:900;color:var(--text);padding:2px 0}

/* Profile activity and stats */
.profile-stats{grid-template-columns:repeat(4,minmax(0,1fr))!important}
.profile-stats .stat-link{display:block;text-decoration:none;color:var(--text);cursor:pointer}
.activity-item{display:flex!important;text-decoration:none;color:var(--text)!important;align-items:center!important}
.activity-item>div{flex:1;min-width:0}
.activity-item>strong{color:var(--muted);font-size:18px}
.activity-item:hover{transform:translateY(-1px);border-color:var(--brand);}
@media(max-width:800px){.profile-stats{grid-template-columns:repeat(2,minmax(0,1fr))!important}}
@media(hover:none){.message .msg-hover-tools{opacity:0;visibility:hidden;display:none!important}.message.tools-open .msg-hover-tools{display:flex!important;opacity:1;visibility:visible;pointer-events:auto}}
@media(max-width:700px){
 .market-tabs{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:5px!important}
 .market-tabs button{white-space:normal!important;line-height:1.15!important;padding:8px 5px!important;font-size:12px!important}
 .market-tools{background:var(--card)!important}
 .profile-cover{height:130px!important}
 .profile-head{margin-top:-42px!important}
}

/* v43 PRO CHAT + MOBILE */
.chat-bubble{position:relative}
.msg-hover-tools{position:absolute;right:12px;top:-18px;z-index:20;display:flex;align-items:center;gap:4px;padding:5px 7px;border:1px solid var(--line,#e2e8f0);border-radius:18px;background:var(--card,#fff);box-shadow:0 8px 25px rgba(15,23,42,.16);opacity:0;visibility:hidden;transform:translateY(5px);transition:opacity .15s ease,transform .15s ease,visibility .15s}
.message:hover .msg-hover-tools,.message:focus-within .msg-hover-tools,.message.tools-open .msg-hover-tools{opacity:1;visibility:visible;transform:translateY(0)}
.quick-reactions{position:absolute;right:0;bottom:calc(100% + 7px);display:flex;gap:3px;padding:5px;background:var(--card,#fff);border:1px solid var(--line,#e2e8f0);border-radius:20px;box-shadow:0 10px 28px rgba(15,23,42,.18);opacity:0;visibility:hidden;transform:translateY(5px) scale(.96);transition:.15s;white-space:nowrap;z-index:30}
.msg-hover-tools:hover .quick-reactions,.msg-hover-tools:focus-within .quick-reactions,.quick-reactions.open{opacity:1;visibility:visible;transform:none}
.quick-reactions .reaction{border:0;background:transparent;border-radius:50%;min-width:34px;height:34px;padding:0;font-size:19px}
.quick-reactions .reaction:hover,.quick-reactions .reaction.active{background:#eef2ff;transform:scale(1.12)}
.quick-emoji-launch{display:none}
.reactions{display:flex;flex-wrap:wrap;gap:4px;margin-top:7px}
.reactions .reaction{border:1px solid var(--line,#e2e8f0);background:var(--card2,#f8fafc);border-radius:999px;padding:3px 8px;font-size:13px}
@media (hover:none),(max-width:760px){
 .msg-hover-tools{position:relative;right:auto;top:auto;margin-top:8px;width:max-content;opacity:1;visibility:visible;transform:none;box-shadow:none;background:transparent;border:0;padding:0}
 .quick-emoji-launch{display:inline-flex}
 .quick-reactions{position:absolute;left:0;right:auto;bottom:calc(100% + 5px)}
 .message:hover .msg-hover-tools{opacity:1;visibility:visible}
}
@media(max-width:760px){
 body.chat-page{padding-bottom:76px}
 header{position:sticky;top:0;padding:9px 12px;min-height:54px}
 .brand.small{font-size:19px}
 .brand.small em{display:none}
 .topnav{display:none}
 main{width:100%;max-width:none;padding-left:10px!important;padding-right:10px!important}
 .chat-layout,.chat-grid{display:block!important}
 .chat-card,.chat-panel,.card{border-radius:16px!important}
 .v27-composer{position:fixed;left:8px;right:8px;bottom:66px;z-index:120;border-radius:18px;padding:7px;box-shadow:0 10px 35px rgba(0,0,0,.18)}
 #messages{padding-bottom:8px;overflow-x:hidden}
 .message{max-width:94%;margin-bottom:10px}
 .chat-bubble{max-width:100%;word-break:break-word}
 .msg-hover-tools .reply-btn{min-height:34px}
 .emoji-panel{max-height:42vh!important;overflow:auto}
 .mobile-nav{position:fixed!important;left:0;right:0;bottom:0;z-index:130;padding:7px 4px calc(7px + env(safe-area-inset-bottom));background:rgba(255,255,255,.96);backdrop-filter:blur(18px);border-top:1px solid var(--line,#e2e8f0)}
 .mobile-nav a{flex:1;min-width:0;text-align:center;font-size:11px;padding:5px 2px}
 .mobile-nav a span{display:block}
 textarea#text{min-height:40px;max-height:110px}
}

/* v43 profile polish */
.profile-shell{max-width:1050px;margin:0 auto;padding:24px 16px 90px}
.profile-modern .profile-card{overflow:hidden;border-radius:28px}
.profile-modern .profile-hero{display:grid;grid-template-columns:auto 1fr auto;gap:22px;align-items:center;padding:28px}
.profile-modern .profile-stats{display:flex;gap:10px;flex-wrap:wrap}
.profile-modern .profile-stat{min-width:110px;padding:12px 15px;border:1px solid var(--line);border-radius:16px;background:var(--card2)}
.profile-modern .profile-actions{display:flex;gap:8px;flex-wrap:wrap}
@media(max-width:700px){
 .profile-shell{padding:10px 10px 85px}
 .profile-modern .profile-hero{grid-template-columns:1fr;text-align:center;padding:20px 14px;gap:14px}
 .profile-modern .profile-hero .avatar{margin:auto;width:88px;height:88px}
 .profile-modern .profile-stats{justify-content:center}
 .profile-modern .profile-stat{flex:1;min-width:0}
 .profile-modern .profile-actions{justify-content:center}
 .profile-modern .profile-actions button,.profile-modern .profile-actions a{min-height:44px}
 .profile-modern .profile-grid{grid-template-columns:1fr!important}
 .profile-modern input,.profile-modern textarea{font-size:16px}
 .profile-nav{overflow-x:auto;white-space:nowrap;-webkit-overflow-scrolling:touch;padding-bottom:2px}
 .profile-nav a{flex:none}
}

/* v47 chat action popup: desktop hover, mobile tap. */
.msg-hover-tools{background:var(--card,#fff)!important;border:1px solid var(--line,#dce2e8)!important;border-radius:14px!important;box-shadow:0 10px 28px rgba(0,0,0,.16)!important;padding:4px 6px!important;max-width:min(92vw,520px)!important;}
.msg-hover-tools .quick-reactions{background:transparent!important;border:0!important;box-shadow:none!important;}
.msg-hover-tools .reply-btn,.msg-hover-tools .reaction{font-size:15px!important;min-width:32px!important;height:32px!important;}
@media (min-width:901px){
  .msg-hover-tools{opacity:0!important;visibility:hidden!important;pointer-events:none!important;transform:translateY(5px)!important;}
  .message:hover .msg-hover-tools,.message:focus-within .msg-hover-tools,.message.tools-open .msg-hover-tools{opacity:1!important;visibility:visible!important;pointer-events:auto!important;transform:translateY(0)!important;}
}
@media (max-width:900px){
  .msg-hover-tools{position:absolute!important;left:8px!important;right:auto!important;top:auto!important;bottom:calc(100% - 2px)!important;margin:0!important;opacity:0!important;visibility:hidden!important;pointer-events:none!important;transform:translateY(6px)!important;overflow-x:auto!important;display:flex!important;max-width:calc(100vw - 28px)!important;}
  .message{position:relative!important;}
  .message.tools-open .msg-hover-tools,.message:focus-within .msg-hover-tools{opacity:1!important;visibility:visible!important;pointer-events:auto!important;transform:translateY(0)!important;}
  .message.tools-open{z-index:20!important;}
  .message.tools-open .msg-hover-tools .reaction,.message.tools-open .msg-hover-tools .reply-btn{touch-action:manipulation!important;}
  .chat-bubble{touch-action:manipulation!important;}
  .msg-actions{display:none!important;}
  .message.tools-open .msg-actions{display:flex!important;}
  .v27-emoji-panel{position:fixed!important;left:10px!important;right:10px!important;bottom:64px!important;width:auto!important;max-width:none!important;max-height:42vh!important;grid-template-columns:repeat(7,minmax(0,1fr))!important;border-radius:18px!important;padding:8px!important;z-index:10000!important;}
  .v27-emoji-panel .emoji-item{width:auto!important;height:40px!important;font-size:23px!important;}
}


/* v54 — profile mobile overflow + Cyrillic input stability */
.profile-modern, .profile-modern * { box-sizing:border-box; }
.profile-modern .profile-card,
.profile-modern .profile-panel,
.profile-modern .profile-content,
.profile-modern .profile-main-col,
.profile-modern .profile-side,
.profile-modern .edit-fields { min-width:0; max-width:100%; }
.profile-modern .profile-title,
.profile-modern .profile-title p,
.profile-modern .activity-item,
.profile-modern .activity-item div,
.profile-modern .quick-panel,
.profile-modern .quote-panel { min-width:0; overflow-wrap:anywhere; word-break:break-word; }
.profile-modern .edit-fields input,
.profile-modern .edit-fields textarea,
.profile-modern .edit-fields select { width:100%; max-width:100%; min-width:0; box-sizing:border-box; font-family:inherit; color:var(--text); }
.profile-modern .edit-fields textarea { resize:vertical; overflow-wrap:anywhere; white-space:pre-wrap; }
@media(max-width:700px){
  .profile-modern .profile-head { grid-template-columns:1fr; width:100%; }
  .profile-modern .profile-title { width:100%; }
  .profile-modern .profile-name-row h1 { max-width:100%; overflow-wrap:anywhere; word-break:break-word; }
  .profile-modern .profile-status-row { flex-wrap:wrap; }
  .profile-modern .profile-content { width:100%; }
  .profile-modern .profile-stats { width:100%; }
  .profile-modern .profile-stats .stat-link { min-width:0; overflow:hidden; }
  .profile-modern .profile-stats .stat-link span { overflow-wrap:anywhere; }
  .profile-modern .edit-grid { width:100%; }
  .profile-modern .save-state { display:block; margin:8px 0 0; }
}

/* v54 — forum mobile */
.forum-page, .forum-page * { box-sizing:border-box; }
.forum-page { min-width:0; max-width:100%; overflow-x:hidden; }
.forum-grid, .forum-card, .topic-list, .topic-row, .forum-category, .topic-main { min-width:0; max-width:100%; }
.forum-category, .topic-row { overflow:hidden; }
.forum-category b, .forum-category small, .topic-main b, .topic-main small { overflow-wrap:anywhere; word-break:break-word; }
.forum-compose-row, .topic-compose { position:relative; min-width:0; }
.forum-compose-row textarea, .topic-compose textarea, #topicTitle, #category { width:100%; max-width:100%; min-width:0; box-sizing:border-box; font-family:inherit; }
@media(max-width:700px){
 .forum-grid { display:block; }
 .forum-category { width:100%; }
 .forum-back { display:grid; grid-template-columns:auto 1fr auto; gap:6px; align-items:center; }
 .forum-back h2 { min-width:0; overflow-wrap:anywhere; }
 .topic-row { grid-template-columns:auto minmax(0,1fr); }
 .topic-last { grid-column:2; }
}

/* v54 — DM voice/call controls */
.chat-tools { flex-wrap:wrap; }
.call-box { max-width:calc(100vw - 24px); }
@media(max-width:700px){
 .chat-tools .dm-action { min-height:40px; }
 .call-box { left:8px; right:8px; bottom:76px; width:auto; max-width:none; }
 .call-box button { min-height:42px; }
 .voice-msg audio { width:100%; max-width:260px; }
}


/* v56 — chat history, quick reactions and mobile polish */
.load-older-btn{
  display:flex; align-items:center; justify-content:center; gap:6px;
  width:fit-content; max-width:92%; margin:8px auto 12px; padding:9px 16px;
  border:1px solid var(--line,#e2e8f0); border-radius:999px;
  background:var(--card,#fff); color:var(--text,#0f172a); font:600 13px/1.2 inherit;
  cursor:pointer; box-shadow:0 5px 18px rgba(15,23,42,.08);
  transition:transform .15s, box-shadow .15s, background .15s;
}
.load-older-btn:hover{transform:translateY(-1px);box-shadow:0 8px 24px rgba(15,23,42,.14);}
.chat-bubble{overflow:visible;}
.msg-hover-tools{z-index:100;}
.quick-reactions{z-index:101;}
.quick-reactions .reaction{cursor:pointer;transition:transform .12s,background .12s;}
@media(max-width:900px){
  #messages{padding-left:2px;padding-right:2px;}
  .load-older-btn{position:sticky;top:6px;z-index:90;margin:6px auto 12px;box-shadow:0 6px 20px rgba(15,23,42,.14);}
  .msg-hover-tools{max-width:calc(100vw - 24px)!important;overflow:visible!important;}
  .msg-hover-tools .quick-reactions{display:flex!important;flex-wrap:nowrap!important;max-width:calc(100vw - 32px)!important;overflow-x:auto!important;-webkit-overflow-scrolling:touch!important;}
  .msg-hover-tools .quick-reactions .reaction{flex:0 0 auto!important;width:38px!important;min-width:38px!important;height:38px!important;font-size:20px!important;}
  .msg-hover-tools .reply-btn{flex:0 0 auto!important;white-space:nowrap!important;}
  .message.tools-open{z-index:50!important;}
  .message.tools-open .msg-hover-tools{box-shadow:0 8px 26px rgba(0,0,0,.18)!important;border:1px solid var(--line,#e2e8f0)!important;border-radius:18px!important;padding:4px!important;background:var(--card,#fff)!important;}
}


/* v57 chat UX: real hover popup on desktop + touch popup on mobile */
.chat-page .msg-hover-tools{
  position:absolute!important;
  top:-38px!important;
  right:8px!important;
  z-index:50!important;
  display:flex!important;
  align-items:center!important;
  gap:2px!important;
  padding:4px 6px!important;
  border:1px solid var(--line)!important;
  border-radius:14px!important;
  background:var(--card,#fff)!important;
  box-shadow:0 10px 28px rgba(0,0,0,.14)!important;
  opacity:0!important;
  visibility:hidden!important;
  transform:translateY(5px) scale(.98)!important;
  transition:opacity .14s ease,transform .14s ease,visibility .14s ease!important;
  pointer-events:none!important;
}
.chat-page .chat-bubble{position:relative!important;}
.chat-page .message:hover .msg-hover-tools,
.chat-page .message:focus-within .msg-hover-tools,
.chat-page .message.tools-open .msg-hover-tools{
  opacity:1!important;visibility:visible!important;transform:none!important;pointer-events:auto!important;
}
.chat-page .msg-hover-tools .quick-reactions{
  display:flex!important;align-items:center!important;gap:1px!important;
}
.chat-page .msg-hover-tools .reaction,
.chat-page .msg-hover-tools .reply-btn{
  display:inline-flex!important;align-items:center!important;justify-content:center!important;
  min-width:32px!important;height:32px!important;padding:3px 6px!important;
  border-radius:9px!important;border:0!important;background:transparent!important;
  color:inherit!important;font-size:17px!important;cursor:pointer!important;
}
.chat-page .msg-hover-tools .reaction:hover,
.chat-page .msg-hover-tools .reply-btn:hover{background:rgba(100,116,139,.12)!important;}
@media(max-width:700px){
 .chat-page .msg-hover-tools{
   position:absolute!important;top:auto!important;bottom:calc(100% + 6px)!important;
   right:4px!important;max-width:calc(100vw - 28px)!important;
   overflow-x:auto!important;white-space:nowrap!important;
   -webkit-overflow-scrolling:touch!important;
   padding:5px!important;border-radius:16px!important;
 }
 .chat-page .message.tools-open .msg-hover-tools{opacity:1!important;visibility:visible!important;transform:none!important;pointer-events:auto!important;}
 .chat-page .message:hover .msg-hover-tools{opacity:0!important;visibility:hidden!important;}
 .chat-page .message.tools-open:hover .msg-hover-tools{opacity:1!important;visibility:visible!important;}
 .chat-page #messages{padding:10px 8px!important;max-height:none!important;}
 .chat-page .chat-bubble{max-width:calc(100vw - 52px)!important;}
 .chat-page .v27-composer-row{gap:4px!important;}
 .chat-page .chat-tool-btn,.chat-page .v27-emoji-btn,.chat-page .v27-send{min-width:42px!important;min-height:42px!important;padding:8px!important;}
 .chat-page #text{font-size:16px!important;min-height:42px!important;}
 .chat-page .voice-msg audio{width:190px!important;max-width:60vw!important;}
}


/* ===== v61 CHAT RESTORE — classic compact messenger layout ===== */
.chat-page #messages{
  padding:18px 14px 28px!important;
  overflow-x:visible!important;
  overflow-y:auto!important;
  scrollbar-gutter:stable;
}
.chat-page #messages .message{
  contain:none!important;
  display:flex!important;
  width:100%!important;
  min-width:0!important;
  margin:7px 0!important;
  padding:0 12px!important;
  align-items:flex-end!important;
  position:relative!important;
  box-sizing:border-box!important;
}
.chat-page #messages .message:not(.me){justify-content:flex-start!important}
.chat-page #messages .message.me{justify-content:flex-end!important}
.chat-page #messages .chat-bubble{
  position:relative!important;
  width:fit-content!important;
  max-width:min(76%,680px)!important;
  min-width:0!important;
  padding:9px 12px 8px!important;
  margin:0!important;
  border-radius:16px 16px 16px 5px!important;
  box-sizing:border-box!important;
  overflow:visible!important;
  box-shadow:0 2px 8px rgba(0,0,0,.12)!important;
}
.chat-page #messages .message.me .chat-bubble{
  border-radius:16px 16px 5px 16px!important;
}
.chat-page #messages .chat-userline,.chat-page #messages .msg-head{
  display:flex!important;align-items:center!important;gap:7px!important;
  min-width:0!important;margin:0 0 2px!important;
}
.chat-page #messages .chat-userline>span,.chat-page #messages .msg-head>span{min-width:0!important}
.chat-page #messages .chat-userline .avatar,.chat-page #messages .msg-head .avatar{
  width:28px!important;height:28px!important;min-width:28px!important;font-size:12px!important;
}
.chat-page #messages .chat-userline b,.chat-page #messages .msg-head b{font-size:12px!important;line-height:1.1!important}
.chat-page #messages .chat-userline small,.chat-page #messages .msg-head small{
  font-size:9px!important;opacity:.65!important;margin-left:5px!important;white-space:nowrap!important;
}
.chat-page #messages .chat-bubble p{
  margin:4px 0 0!important;padding:0!important;
  font-size:15px!important;line-height:1.42!important;
  white-space:pre-wrap!important;overflow-wrap:anywhere!important;word-break:break-word!important;
}
.chat-page #messages .reply-preview{
  margin:5px 0 5px!important;padding:5px 8px!important;
  border-left:3px solid var(--brand,#2563eb)!important;
  border-radius:6px!important;background:rgba(37,99,235,.08)!important;
  max-width:100%!important;
}
.chat-page #messages .reply-preview p{font-size:12px!important;line-height:1.25!important;margin:2px 0 0!important}
.chat-page #messages .chat-photo{display:block!important;max-width:100%!important;height:auto!important;border-radius:11px!important;margin-top:6px!important}
.chat-page #messages .voice-msg{display:flex!important;align-items:center!important;gap:6px!important;margin-top:6px!important;max-width:100%!important}
.chat-page #messages .voice-msg audio{width:min(300px,100%)!important;max-width:100%!important;height:36px!important}
.chat-page #messages .reactions{display:flex!important;flex-wrap:wrap!important;gap:3px!important;margin-top:4px!important}
.chat-page #messages .reactions:empty{display:none!important}
.chat-page #messages .reactions .reaction{min-height:23px!important;padding:2px 6px!important;border-radius:999px!important;font-size:12px!important}

/* Popup directly under the message: emoji + reply + pin + other actions */
.chat-page #messages .msg-hover-tools{
  position:absolute!important;
  top:calc(100% + 5px)!important;
  bottom:auto!important;
  left:auto!important;
  right:4px!important;
  z-index:1000!important;
  display:flex!important;
  align-items:center!important;
  gap:3px!important;
  width:max-content!important;
  max-width:min(92vw,520px)!important;
  min-height:36px!important;
  padding:4px 6px!important;
  margin:0!important;
  border:1px solid rgba(148,163,184,.35)!important;
  border-radius:15px!important;
  background:var(--card,#fff)!important;
  color:var(--text,#0f172a)!important;
  box-shadow:0 8px 24px rgba(15,23,42,.18)!important;
  opacity:0!important;visibility:hidden!important;pointer-events:none!important;
  transform:translateY(-3px) scale(.98)!important;
  transition:opacity .13s ease,transform .13s ease,visibility .13s ease!important;
}
.chat-page #messages .message:not(.me) .msg-hover-tools{left:4px!important;right:auto!important}
.chat-page #messages .message:hover .msg-hover-tools,
.chat-page #messages .message:focus-within .msg-hover-tools,
.chat-page #messages .message.tools-open .msg-hover-tools{
  opacity:1!important;visibility:visible!important;pointer-events:auto!important;transform:translateY(0) scale(1)!important;
}
.chat-page #messages .msg-hover-tools .quick-reactions{
  display:flex!important;align-items:center!important;gap:1px!important;margin:0!important;padding:0!important;background:transparent!important;
}
.chat-page #messages .msg-hover-tools .reaction,
.chat-page #messages .msg-hover-tools .reply-btn{
  display:inline-flex!important;align-items:center!important;justify-content:center!important;
  flex:0 0 auto!important;width:auto!important;min-width:32px!important;height:32px!important;
  padding:0 7px!important;margin:0!important;border:0!important;border-radius:9px!important;
  background:transparent!important;color:var(--text,#0f172a)!important;cursor:pointer!important;
  font-size:16px!important;white-space:nowrap!important;
}
.chat-page #messages .msg-hover-tools .reaction{font-size:19px!important;padding:0 5px!important}
.chat-page #messages .msg-hover-tools .reaction small{font-size:10px!important;margin-left:2px!important}
.chat-page #messages .msg-hover-tools .reply-action{font-size:13px!important}
.chat-page #messages .msg-hover-tools .reaction:hover,
.chat-page #messages .msg-hover-tools .reply-btn:hover{background:rgba(37,99,235,.10)!important}
.chat-page #messages .msg-hover-tools .reaction.active{background:rgba(37,99,235,.16)!important}
.chat-page #messages .tool-divider{width:1px!important;height:22px!important;background:var(--line,#dbe3ec)!important;flex:0 0 1px!important;margin:0 2px!important}
body.dark .chat-page #messages .msg-hover-tools{background:#172230!important;border-color:#334155!important;color:#f8fafc!important}
body.dark .chat-page #messages .msg-hover-tools .reply-btn,body.dark .chat-page #messages .msg-hover-tools .reaction{color:#f8fafc!important}

/* @username suggestions */
.chat-page .v27-composer{position:relative!important;overflow:visible!important}
.chat-page .mention-panel{
  position:absolute!important;left:10px!important;right:auto!important;bottom:calc(100% + 7px)!important;
  width:min(340px,calc(100vw - 30px))!important;max-height:300px!important;overflow:auto!important;
  display:grid;gap:3px;padding:6px!important;z-index:10000!important;
  background:var(--card,#fff)!important;border:1px solid var(--line,#dbe3ec)!important;
  border-radius:14px!important;box-shadow:0 14px 36px rgba(0,0,0,.22)!important;
}
.chat-page .mention-option{display:flex!important;align-items:center!important;gap:8px!important;width:100%!important;padding:7px 8px!important;border:0!important;border-radius:10px!important;background:transparent!important;color:var(--text)!important;text-align:left!important;cursor:pointer!important}
.chat-page .mention-option:hover{background:rgba(37,99,235,.09)!important}
.chat-page .mention-option .avatar{width:30px!important;height:30px!important;min-width:30px!important}
.chat-page .mention-option span:last-child{display:flex!important;flex-direction:column!important;min-width:0!important}
.chat-page .mention-option b{font-size:13px!important}
.chat-page .mention-option small{font-size:10px!important;opacity:.65!important}
.chat-page .mention-link{color:var(--brand,#2563eb)!important;font-weight:700!important;text-decoration:none!important}
body.dark .chat-page .mention-panel{background:#172230!important;border-color:#334155!important}

@media(max-width:900px){
  .chat-page #messages .message{padding:0 8px!important;margin:6px 0!important}
  .chat-page #messages .chat-bubble{max-width:82%!important}
}
@media(max-width:700px){
  .chat-page #messages{padding:10px 5px 18px!important}
  .chat-page #messages .message{padding:0 4px!important;margin:6px 0!important}
  .chat-page #messages .chat-bubble{max-width:91%!important;padding:8px 10px 7px!important;border-radius:15px 15px 15px 5px!important}
  .chat-page #messages .message.me .chat-bubble{border-radius:15px 15px 5px 15px!important}
  .chat-page #messages .chat-bubble p{font-size:15px!important;line-height:1.4!important}
  .chat-page #messages .chat-userline .avatar,.chat-page #messages .msg-head .avatar{width:26px!important;height:26px!important;min-width:26px!important}
  .chat-page #messages .msg-hover-tools{position:absolute!important;top:calc(100% + 4px)!important;left:4px!important;right:auto!important;max-width:calc(100vw - 18px)!important;overflow-x:auto!important;scrollbar-width:none!important}
  .chat-page #messages .message.me .msg-hover-tools{left:auto!important;right:4px!important}
  .chat-page #messages .message:hover .msg-hover-tools{opacity:0!important;visibility:hidden!important;pointer-events:none!important}
  .chat-page #messages .message.tools-open .msg-hover-tools,.chat-page #messages .message:focus-within .msg-hover-tools{opacity:1!important;visibility:visible!important;pointer-events:auto!important;transform:none!important}
  .chat-page #messages .msg-hover-tools .reply-btn{font-size:12px!important}
  .chat-page #messages .msg-hover-tools .reaction{min-width:32px!important;width:32px!important;padding:0!important}
  .chat-page .mention-panel{left:7px!important;width:calc(100vw - 28px)!important}
}

/* ===== v62 CHAT BUBBLES — roomy, aligned, popup tools with reserved space ===== */
.chat-page #messages{
  padding:18px 18px 34px!important;
}
.chat-page #messages .message{
  width:100%!important;
  padding:0 8px!important;
  margin:10px 0!important;
  align-items:flex-start!important;
  transition:padding-bottom .16s ease, margin-bottom .16s ease!important;
}
.chat-page #messages .message:not(.me){justify-content:flex-start!important}
.chat-page #messages .message.me{justify-content:flex-end!important}
.chat-page #messages .chat-bubble{
  width:auto!important;
  max-width:min(78%,760px)!important;
  min-width:180px!important;
  padding:11px 14px 10px!important;
  border-radius:17px 17px 17px 6px!important;
}
.chat-page #messages .message.me .chat-bubble{border-radius:17px 17px 6px 17px!important}
.chat-page #messages .chat-bubble p{
  font-size:16px!important;
  line-height:1.45!important;
  margin:5px 0 0!important;
}
.chat-page #messages .chat-userline,.chat-page #messages .msg-head{
  margin-bottom:3px!important;
}

/* Toolbar lives BELOW the bubble, but is hidden until hover/tap. */
.chat-page #messages .msg-hover-tools{
  top:calc(100% + 7px)!important;
  bottom:auto!important;
  left:0!important;
  right:auto!important;
  min-height:38px!important;
  padding:4px 7px!important;
  border-radius:14px!important;
  transform:translateY(-5px) scale(.97)!important;
  transform-origin:top left!important;
}
.chat-page #messages .message.me .msg-hover-tools{
  left:auto!important;
  right:0!important;
  transform-origin:top right!important;
}
.chat-page #messages .message:hover,
.chat-page #messages .message.tools-open,
.chat-page #messages .message:focus-within{
  padding-bottom:48px!important;
}
.chat-page #messages .message:hover .msg-hover-tools,
.chat-page #messages .message.tools-open .msg-hover-tools,
.chat-page #messages .message:focus-within .msg-hover-tools{
  transform:translateY(0) scale(1)!important;
}
.chat-page #messages .msg-hover-tools .quick-reactions{
  gap:2px!important;
}
.chat-page #messages .msg-hover-tools .reaction,
.chat-page #messages .msg-hover-tools .reply-btn{
  height:34px!important;
  min-width:34px!important;
  border-radius:10px!important;
}
.chat-page #messages .msg-hover-tools .reply-action{
  padding:0 10px!important;
  font-size:13px!important;
  font-weight:600!important;
}

@media(max-width:700px){
  .chat-page #messages{padding:10px 8px 24px!important}
  .chat-page #messages .message{
    padding:0 3px!important;
    margin:9px 0!important;
  }
  .chat-page #messages .chat-bubble{
    max-width:88%!important;
    min-width:150px!important;
    padding:10px 12px 9px!important;
  }
  .chat-page #messages .chat-bubble p{
    font-size:15.5px!important;
    line-height:1.43!important;
  }
  .chat-page #messages .message:hover,
  .chat-page #messages .message.tools-open,
  .chat-page #messages .message:focus-within{
    padding-bottom:46px!important;
  }
  .chat-page #messages .msg-hover-tools{
    max-width:calc(100vw - 24px)!important;
    overflow-x:auto!important;
    scrollbar-width:none!important;
  }
  .chat-page #messages .msg-hover-tools::-webkit-scrollbar{display:none!important}
  .chat-page #messages .msg-hover-tools .reply-action{font-size:12px!important;padding:0 8px!important}
}

/* ===== v63 MOBILE COMPOSER — SEND BUTTON ALWAYS ON THE RIGHT ===== */
@media (max-width:700px){
  .chat-page .v27-composer-row{
    display:flex!important;
    flex-direction:row!important;
    align-items:flex-end!important;
    gap:5px!important;
    width:100%!important;
    box-sizing:border-box!important;
  }
  .chat-page .v27-composer-row #text{
    order:1!important;
    flex:1 1 auto!important;
    min-width:0!important;
  }
  .chat-page .v27-composer-row #voiceBtn{
    order:2!important;
    flex:0 0 40px!important;
    width:40px!important;
    min-width:40px!important;
  }
  .chat-page .v27-composer-row .v27-emoji-btn{
    order:3!important;
    flex:0 0 40px!important;
    width:40px!important;
    min-width:40px!important;
  }
  .chat-page .v27-composer-row .composer-photo-btn{
    order:4!important;
    flex:0 0 40px!important;
    width:40px!important;
    min-width:40px!important;
  }
  .chat-page .v27-composer-row .v27-send{
    order:5!important;
    flex:0 0 40px!important;
    width:40px!important;
    min-width:40px!important;
    margin-left:0!important;
  }
}
@media (max-width:430px){
  .chat-page .v27-composer-row{gap:3px!important;padding:4px!important}
  .chat-page .v27-composer-row #voiceBtn,
  .chat-page .v27-composer-row .v27-emoji-btn,
  .chat-page .v27-composer-row .composer-photo-btn,
  .chat-page .v27-composer-row .v27-send{
    flex-basis:38px!important;width:38px!important;min-width:38px!important;height:38px!important;
  }
}

/* ===== v64 CHAT AVATARS — ALWAYS PERFECT CIRCLES ===== */
.chat-page #messages .chat-userline .avatar,
.chat-page #messages .chat-userline img.avatar,
.chat-page #messages .msg-head .avatar,
.chat-page #messages .msg-head img.avatar{
  width:34px!important;
  height:34px!important;
  min-width:34px!important;
  max-width:34px!important;
  min-height:34px!important;
  max-height:34px!important;
  flex:0 0 34px!important;
  aspect-ratio:1 / 1!important;
  display:block!important;
  border-radius:50%!important;
  overflow:hidden!important;
  object-fit:cover!important;
  object-position:center!important;
  box-sizing:border-box!important;
}
.chat-page #messages .chat-userline .avatar img,
.chat-page #messages .msg-head .avatar img{
  width:100%!important;
  height:100%!important;
  min-width:100%!important;
  min-height:100%!important;
  max-width:100%!important;
  max-height:100%!important;
  display:block!important;
  border-radius:50%!important;
  object-fit:cover!important;
}
@media(max-width:700px){
  .chat-page #messages .chat-userline .avatar,
  .chat-page #messages .chat-userline img.avatar,
  .chat-page #messages .msg-head .avatar,
  .chat-page #messages .msg-head img.avatar{
    width:32px!important;
    height:32px!important;
    min-width:32px!important;
    max-width:32px!important;
    min-height:32px!important;
    max-height:32px!important;
    flex-basis:32px!important;
  }
}


/* ===== v65 FIXES: message search, voice, mobile market/profile ===== */
.search-empty{padding:30px 16px;text-align:center;color:var(--muted,#64748b);font-weight:700;}
@media(max-width:700px){
  .market-page header .brand.small{min-width:0;max-width:58vw;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:clamp(15px,4.8vw,20px)!important;}
  .market-page header .brand.small b{display:inline!important;white-space:nowrap;}
  .profile-modern .edit-avatar{min-width:0;max-width:100%;overflow:hidden;}
  .profile-modern .edit-avatar .profile-btn,
  .profile-modern .edit-avatar .text-danger{display:block;width:100%;max-width:100%;box-sizing:border-box;white-space:normal;overflow-wrap:anywhere;word-break:break-word;}
  .profile-modern .edit-avatar .text-danger{padding:10px 12px;text-align:center;border-radius:12px;}
  .chat-page #messageSearch{width:100%;min-width:0;box-sizing:border-box;}
  .chat-page .search-empty{margin:0 8px;border-radius:14px;}
}
@media(min-width:701px){.market-page header .brand.small{min-width:0;}.market-page header .brand.small b{white-space:nowrap;}}



/* v68 notifications, profile overflow, mobile header and admin background */
.notification-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px}.notification-actions button,.notification-actions a{min-height:38px;padding:8px 12px;border-radius:10px;text-decoration:none;display:inline-flex;align-items:center;justify-content:center}.admin-bg-tools{display:flex;gap:10px;align-items:end;flex-wrap:wrap;grid-column:1/-1;margin-top:8px}.admin-bg-tools label{flex:1;min-width:220px}.admin-bg-tools input[type=file]{display:block;width:100%;margin-top:6px}.admin-bg-tools button{margin-right:6px}.admin-bg-tools small{color:var(--muted)}.profile-title p,.activity-item,.activity-item div,.profile-panel,.profile-main-col{min-width:0}.profile-title p{overflow-wrap:anywhere;word-break:break-word}.activity-item div{overflow:hidden}.activity-item b,.activity-item small{overflow-wrap:anywhere;word-break:break-word}.brand{min-width:0}.brand b{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.topnav{min-width:0}
@media(max-width:700px){.notification-actions{display:grid;grid-template-columns:1fr 1fr}.notification-actions a{grid-column:1/-1}.admin-bg-tools{display:block}.admin-bg-tools>*{margin-top:8px}.profile-title p{max-width:100%}.activity-item{width:100%;box-sizing:border-box}.brand b{max-width:52vw}.brand span{display:none!important}}
.global-notify-badge{position:absolute!important;right:-5px!important;top:-7px!important;min-width:17px!important;height:17px!important;padding:0 4px!important;border-radius:999px!important;background:#e11d48!important;color:#fff!important;font-size:10px!important;font-weight:900!important;align-items:center!important;justify-content:center!important;line-height:1!important;border:2px solid var(--card,#fff)!important;box-sizing:border-box!important}
/* v68 final mobile/profile fixes */
.profile-modern .profile-panel,.profile-modern .activity-list,.profile-modern .activity-item{max-width:100%;overflow:hidden;box-sizing:border-box}
.profile-modern .profile-title p{white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word}
.profile-modern .activity-item{min-width:0}
.profile-modern .activity-item>div{min-width:0;max-width:100%}
.chat-page header .brand em{display:none!important}
@media(max-width:700px){
  .profile-modern .profile-content{width:100%;box-sizing:border-box}
  .profile-modern .profile-main-col{width:100%;min-width:0}
  .profile-modern .profile-panel{width:100%;padding:12px!important}
  .profile-modern .activity-item{width:100%;display:flex!important}
  .profile-modern .activity-item b,.profile-modern .activity-item small{white-space:normal;overflow-wrap:anywhere;word-break:break-word}
  .profile-modern .profile-title p{font-size:13px;line-height:1.5}
  .admin-bg-tools{width:100%;box-sizing:border-box}
}

/* v69 mobile site brand fit */
@media (max-width:640px){
  header{min-width:0;overflow:hidden;}
  header .brand.small, header .brand{min-width:0!important;max-width:46vw!important;flex:0 1 auto!important;overflow:hidden!important;white-space:nowrap!important;text-overflow:clip!important;font-size:14px!important;letter-spacing:-.035em!important;gap:0!important;}
  header .brand.small b, header .brand b{display:inline-block!important;max-width:100%!important;overflow:hidden!important;white-space:nowrap!important;text-overflow:clip!important;vertical-align:middle;}
  header .brand.small:first-letter, header .brand:first-letter{font-size:13px;}
  header .topnav{min-width:0!important;flex:1 1 auto!important;overflow-x:auto!important;white-space:nowrap!important;}
  header .topnav a, header .topnav .theme-btn{flex:0 0 auto!important;}
}
@media (max-width:380px){
  header .brand.small, header .brand{max-width:43vw!important;font-size:13px!important;}
}
\n/* v70 notification + forum counters */
.global-notify-badge,.forum-new-badge{position:absolute!important;top:-7px;right:-7px;z-index:20;display:inline-flex;align-items:center;justify-content:center;min-width:20px;height:20px;padding:0 6px;border-radius:999px;box-sizing:border-box;background:#e11d48;color:#fff!important;font:700 11px/20px Arial,sans-serif;white-space:nowrap;pointer-events:none;box-shadow:0 2px 7px rgba(0,0,0,.18);transform:none!important;}
@media(max-width:700px){.global-notify-badge,.forum-new-badge{top:-4px;right:-3px;min-width:18px;height:18px;padding:0 5px;font-size:10px;line-height:18px;}.mobile-nav a{position:relative;min-width:0;}.mobile-nav .global-notify-badge,.mobile-nav .forum-new-badge{top:0;right:calc(50% - 24px);}}
/* announcement/market category chips */
.market-category-chips{display:flex;gap:8px;overflow:auto;padding:2px 0 10px;scrollbar-width:thin}.market-category-chip{flex:0 0 auto;border:1px solid var(--line);background:var(--card,#fff);border-radius:999px;padding:9px 13px;cursor:pointer;white-space:nowrap}.market-category-chip.active{font-weight:700;box-shadow:0 0 0 2px rgba(0,0,0,.08)}
@media(max-width:700px){.market-category-chips{margin-inline:-2px;padding-inline:2px 4px}.market-category-chip{padding:8px 11px}}


/* v71 profile desktop cleanup */
.profile-modern .profile-content{min-width:0;}
.profile-modern .profile-main-col{min-width:0;max-width:100%;}
.profile-modern .edit-panel{min-width:0;overflow:hidden;}
.profile-modern .edit-grid{min-width:0;}
.profile-modern .edit-avatar,.profile-modern .edit-fields{min-width:0;max-width:100%;}
.profile-modern .edit-avatar .profile-btn,.profile-modern .edit-avatar .text-danger{max-width:100%;box-sizing:border-box;}
.profile-modern .edit-fields input,.profile-modern .edit-fields textarea{width:100%;max-width:100%;box-sizing:border-box;}
@media(max-width:900px){
  .profile-modern .profile-content{grid-template-columns:minmax(0,1fr);}
  .profile-modern .profile-side{width:100%;min-width:0;}
  .profile-modern .edit-grid{grid-template-columns:minmax(110px,150px) minmax(0,1fr);gap:14px;}
}
@media(max-width:700px){
  .profile-modern .edit-grid{grid-template-columns:1fr;}
  .profile-modern .edit-avatar{align-items:stretch;}
  .profile-modern .edit-avatar .profile-avatar-xl.small{align-self:center;}
  .profile-modern .edit-avatar .profile-btn,.profile-modern .edit-avatar .text-danger{width:100%;}
}

/* v72 single notification counter */
.global-notify-badge{max-width:52px;overflow:hidden;text-overflow:ellipsis;}

/* v74: clean duplicate desktop top navigation */
@media (min-width: 641px){
  header .topnav a[href="forum.php"],
  header .topnav a[href="active.php"]{display:none!important;}
}
/* Keep mobile bottom navigation and profile navigation intact. */
/* v76 unified profile + mobile theme */
.profile-tabs-single{display:flex!important;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}
.profile-tabs-single>span{font-weight:900}
.profile-theme-btn{cursor:pointer;border:1px solid var(--line)!important;background:var(--card2)!important;color:inherit!important}
.profile-panel{min-width:0;max-width:100%;overflow:hidden}
.activity-item,.activity-item>div{min-width:0}.activity-item b,.activity-item small{overflow-wrap:anywhere;word-break:break-word}
.edit-fields,.edit-fields label{min-width:0}.edit-fields input,.edit-fields textarea{box-sizing:border-box;max-width:100%;width:100%}
@media(max-width:800px){.profile-tabs-single{padding:8px 12px}.profile-theme-btn{display:inline-flex!important;align-items:center;justify-content:center;min-height:40px}.profile-content,.profile-main-col,.profile-side{min-width:0}.activity-item{grid-template-columns:auto minmax(0,1fr) auto!important}}

/* v93 optimization */
.user-badge{display:inline-flex;align-items:center;justify-content:center;font-size:16px;line-height:1;vertical-align:middle;margin-right:3px}.admin-badge{display:inline-flex!important;vertical-align:middle!important;margin:0 4px 0 0!important;line-height:1!important}.profile-name-row h1 .user-badge{font-size:.62em;margin-right:5px}.messages-panel{margin-top:16px}.conversation-list{display:flex;flex-direction:column;gap:4px}.conversation-row{display:flex;align-items:center;gap:12px;padding:11px 10px;border-radius:14px;color:var(--text);border:1px solid transparent}.conversation-row:hover{background:var(--card2);border-color:var(--line)}.conversation-avatar{width:46px;height:46px;min-width:46px;border-radius:50%;overflow:hidden;background:var(--card2);display:flex;align-items:center;justify-content:center;font-size:23px}.conversation-avatar img{width:100%;height:100%;object-fit:cover}.conversation-main{min-width:0;flex:1;display:flex;flex-direction:column}.conversation-main small{color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.conversation-meta{display:flex;flex-direction:column;align-items:flex-end;gap:4px;font-size:11px;color:var(--muted)}.conversation-meta i{font-style:normal;background:var(--brand);color:#fff;border-radius:999px;padding:1px 6px;font-weight:800}@media(max-width:700px){.market-category-chips{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;overflow:visible!important}.market-category-chip{min-height:44px!important;white-space:normal!important}.chat-page #messages .msg-hover-tools{top:auto!important;bottom:calc(100% + 6px)!important;left:4px!important;right:auto!important;max-width:calc(100vw - 18px)!important;transform:translateY(6px)!important;z-index:200!important}.chat-page #messages .message.me .msg-hover-tools{left:auto!important;right:4px!important}.chat-page #messages .message.tools-open .msg-hover-tools{transform:none!important}.profile-name-row h1{display:flex;align-items:center;flex-wrap:wrap;gap:2px}.conversation-row{padding:10px 6px}}

/* v94 mobile dark-market + profile messages + admin crown alignment */
@media(max-width:700px){
  .market-category-chip,.market-category-chip:hover,.market-category-chip:focus{color:#fff!important;background:rgba(255,255,255,.08)!important;border-color:rgba(255,255,255,.22)!important;text-shadow:0 1px 2px rgba(0,0,0,.8)!important;}
  .market-category-chip.active{color:#fff!important;background:var(--brand,#d90429)!important;border-color:var(--brand,#d90429)!important;}
  .profile-tab-links{display:flex;align-items:center;gap:6px;flex-wrap:wrap;}
  .profile-tab-links a{padding:8px 10px!important;border:1px solid var(--line);border-radius:10px;background:var(--card2);color:var(--text)!important;text-decoration:none!important;}
}
.chat-userline,.msg-head{display:flex;align-items:center;}
.chat-userline>span:last-child,.msg-head>span:last-child{display:flex;align-items:center;gap:5px;}
.chat-userline .admin-badge,.msg-head .admin-badge{position:relative;top:0!important;transform:none!important;vertical-align:middle!important;display:inline-flex!important;align-items:center;justify-content:center;height:1.15em;line-height:1!important;}
.profile-name-row h1{display:flex;align-items:center;line-height:1.15;}
.profile-name-row h1 .admin-badge{position:relative;top:0!important;transform:none!important;align-self:center;}

/* v97 restore classic chat actions: buttons under the message + emoji popup */
.chat-page #messages .message{position:relative!important;overflow:visible!important;}
.chat-page #messages .chat-bubble{overflow:visible!important;}
.chat-page #messages .msg-hover-tools{
  top:calc(100% + 7px)!important;
  bottom:auto!important;
  left:0!important;
  right:auto!important;
  min-height:38px!important;
  padding:4px 7px!important;
  border-radius:14px!important;
  transform:translateY(-5px) scale(.97)!important;
  transform-origin:top left!important;
  z-index:99999!important;
}
.chat-page #messages .message.me .msg-hover-tools{
  left:auto!important;
  right:0!important;
  transform-origin:top right!important;
}
.chat-page #messages .message:hover,
.chat-page #messages .message.tools-open,
.chat-page #messages .message:focus-within{padding-bottom:48px!important;}
.chat-page #messages .message:hover .msg-hover-tools,
.chat-page #messages .message.tools-open .msg-hover-tools,
.chat-page #messages .message:focus-within .msg-hover-tools{
  transform:translateY(0) scale(1)!important;
}
.chat-page #messages .msg-hover-tools .quick-reactions{gap:2px!important;}
.chat-page #messages .msg-hover-tools .reaction,
.chat-page #messages .msg-hover-tools .reply-btn{
  height:34px!important;min-width:34px!important;border-radius:10px!important;
}
.chat-page #messages .msg-hover-tools .reply-action{padding:0 10px!important;font-size:13px!important;font-weight:600!important;}
@media(max-width:700px){
  .chat-page #messages .message.tools-open,
  .chat-page #messages .message:focus-within{padding-bottom:46px!important;}
  .chat-page #messages .msg-hover-tools{
    top:calc(100% + 4px)!important;
    bottom:auto!important;
    left:0!important;right:auto!important;
    max-width:calc(100vw - 24px)!important;
    overflow-x:auto!important;
    scrollbar-width:none!important;
    transform:translateY(-3px) scale(.98)!important;
  }
  .chat-page #messages .msg-hover-tools::-webkit-scrollbar{display:none!important;}
  .chat-page #messages .message.me .msg-hover-tools{left:auto!important;right:0!important;}
  .chat-page #messages .message:hover .msg-hover-tools,
  .chat-page #messages .message.tools-open .msg-hover-tools,
  .chat-page #messages .message:focus-within .msg-hover-tools{transform:translateY(0) scale(1)!important;}
  .chat-page #messages .message:last-child{margin-bottom:72px!important;}
}
/* v97 admin crown baseline: keep crown exactly on the login line */
.admin-badge{
  position:relative!important;
  top:0!important;
  bottom:auto!important;
  transform:translateY(-1px)!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  vertical-align:baseline!important;
  line-height:1!important;
}
.chat-userline .admin-badge,.msg-head .admin-badge,
.profile-name-row h1 .admin-badge{
  align-self:center!important;
  transform:translateY(-1px)!important;
}


/* v98: restore stable chat controls layout -- toolbar below message, reactions as popup */
.chat-page #messages .message{position:relative;overflow:visible!important;}
.chat-page #messages .chat-bubble{position:relative;overflow:visible!important;}
.chat-page #messages .msg-hover-tools{
  position:relative!important;left:auto!important;right:auto!important;top:auto!important;bottom:auto!important;
  width:max-content!important;max-width:100%!important;margin:8px 0 0!important;padding:4px 6px!important;
  display:flex!important;align-items:center!important;gap:5px!important;flex-wrap:wrap!important;
  background:var(--card,#fff)!important;border:1px solid var(--line,#dce2e8)!important;border-radius:14px!important;
  box-shadow:0 6px 18px rgba(0,0,0,.12)!important;z-index:50!important;
  opacity:0!important;visibility:hidden!important;pointer-events:none!important;transform:translateY(4px)!important;
}
.chat-page #messages .message:hover .msg-hover-tools,
.chat-page #messages .message:focus-within .msg-hover-tools,
.chat-page #messages .message.tools-open .msg-hover-tools{
  opacity:1!important;visibility:visible!important;pointer-events:auto!important;transform:none!important;
}
.chat-page #messages .quick-emoji-launch{
  display:inline-flex!important;align-items:center!important;justify-content:center!important;width:34px!important;height:34px!important;
  padding:0!important;border:1px solid var(--line,#dce2e8)!important;border-radius:10px!important;
  background:var(--card2,#f8fafc)!important;color:var(--text,#111827)!important;font-size:18px!important;cursor:pointer!important;
}
.chat-page #messages .quick-emoji-launch:hover{background:var(--brand,#2563eb)!important;color:#fff!important;}
.chat-page #messages .quick-reactions{
  position:absolute!important;left:4px!important;right:auto!important;bottom:calc(100% + 7px)!important;
  display:flex!important;align-items:center!important;gap:3px!important;width:max-content!important;max-width:min(92vw,360px)!important;
  padding:5px!important;background:var(--card,#fff)!important;border:1px solid var(--line,#dce2e8)!important;
  border-radius:18px!important;box-shadow:0 10px 28px rgba(0,0,0,.18)!important;z-index:100!important;
  opacity:0!important;visibility:hidden!important;pointer-events:none!important;transform:translateY(5px) scale(.96)!important;
  overflow-x:auto!important;white-space:nowrap!important;
}
.chat-page #messages .quick-reactions.open{opacity:1!important;visibility:visible!important;pointer-events:auto!important;transform:none!important;}
.chat-page #messages .quick-reactions .reaction{flex:0 0 auto!important;width:36px!important;min-width:36px!important;height:36px!important;padding:0!important;
  display:inline-flex!important;align-items:center!important;justify-content:center!important;border:0!important;border-radius:50%!important;
  background:transparent!important;color:inherit!important;font-size:19px!important;cursor:pointer!important;}
.chat-page #messages .quick-reactions .reaction:hover{background:rgba(100,116,139,.14)!important;transform:scale(1.08);}
.chat-page #messages .msg-hover-tools .reply-btn{display:inline-flex!important;align-items:center!important;justify-content:center!important;min-height:34px!important;
  padding:6px 9px!important;border:1px solid var(--line,#dce2e8)!important;border-radius:10px!important;background:var(--card2,#f8fafc)!important;color:var(--text,#111827)!important;}
@media(max-width:700px){
  .chat-page #messages .message{overflow:visible!important;}
  .chat-page #messages .msg-hover-tools{max-width:calc(100vw - 40px)!important;}
  .chat-page #messages .quick-reactions{max-width:calc(100vw - 44px)!important;}
  .chat-page #messages .message.me .msg-hover-tools{margin-left:auto!important;}
}
/* v98: keep admin crown exactly on the login baseline */
.chat-page .chat-userline,.chat-page .msg-head,.profile-name-row{align-items:center!important;}
.chat-page .chat-userline .admin-badge,.chat-page .msg-head .admin-badge,.profile-name-row .admin-badge{position:static!important;top:auto!important;transform:none!important;vertical-align:middle!important;line-height:1!important;display:inline-flex!important;align-items:center!important;}

/* v102 — targeted fixes only: profile theme, chat quick reactions on every message, notification badge containment. */
.profile-modern{min-width:0;overflow-x:hidden}
.profile-modern .profile-card{min-width:0}
.profile-modern .profile-panel{min-width:0}

/* Quick emoji launcher must be available for both own and other users' messages. */
.chat-page #messages .message .msg-hover-tools{overflow:visible!important}
.chat-page #messages .message .quick-emoji-launch{position:relative!important;z-index:102!important;pointer-events:auto!important;touch-action:manipulation!important}
.chat-page #messages .message .quick-reactions{z-index:1000!important;pointer-events:none!important}
.chat-page #messages .message .quick-reactions.open{pointer-events:auto!important}
.chat-page #messages .message:not(.me) .msg-hover-tools{left:0!important;right:auto!important}
.chat-page #messages .message.me .msg-hover-tools{left:auto!important;right:0!important}
@media(max-width:700px){
  .chat-page #messages .message:not(.me) .msg-hover-tools{left:0!important;right:auto!important}
  .chat-page #messages .message.me .msg-hover-tools{left:auto!important;right:0!important}
  .chat-page #messages .message .quick-reactions{max-width:calc(100vw - 30px)!important}
}

/* Keep the notification counter inside the bell/link instead of outside the site. */
.topnav a[href="notifications.php"],
.mobile-nav a[href="notifications.php"]{position:relative!important;overflow:visible!important;isolation:isolate}
.topnav a[href="notifications.php"] .global-notify-badge,
.mobile-nav a[href="notifications.php"] .global-notify-badge{right:2px!important;top:2px!important;transform:none!important;max-width:44px!important}
@media(max-width:700px){
  .mobile-nav a[href="notifications.php"] .global-notify-badge{right:4px!important;top:1px!important;max-width:40px!important}
}

/* v104 social polish */
.forum-social-actions{display:flex;gap:7px;flex-wrap:wrap;margin-top:10px}.forum-social-actions button{border:1px solid var(--line,#dce2e8);background:var(--card2,#f8fafc);color:var(--text,#111827);border-radius:10px;padding:7px 10px;cursor:pointer}.forum-social-actions button.active{color:#d90429;background:rgba(217,4,41,.08)}.forum-reply-ref{margin:8px 0;padding:7px 10px;border-left:3px solid var(--brand,#2563eb);background:var(--card2,#f8fafc);border-radius:8px;font-size:12px}.forum-user-link,.chat-user-link,.profile-user-link{color:inherit;text-decoration:none}.forum-user-link:hover,.chat-user-link:hover,.profile-user-link:hover{text-decoration:underline}.wall-permission{display:flex;align-items:center;gap:8px;margin:10px 0;font-size:14px}.profile-user-link{font-weight:750}
.chat-page #messages .quick-reactions .reaction{font-family:Arial,"Noto Color Emoji","Segoe UI Emoji",sans-serif!important;font-size:22px!important;line-height:1!important;overflow:visible!important;clip-path:none!important}.chat-page #messages .quick-reactions{overflow:visible!important;align-items:center!important}.chat-page #messages .quick-reactions .reaction small{line-height:1!important}
.global-notify-badge,.forum-new-badge,.ann-new-badge{box-sizing:border-box;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:46px}
/* v106 profile/social + online/pinned polish */
.profile-social-nav{display:flex;gap:7px;flex-wrap:wrap;padding:10px 14px;margin:12px 0;border:1px solid var(--line);border-radius:16px;background:var(--card);position:relative;z-index:2}
.profile-social-nav a{display:inline-flex;align-items:center;justify-content:center;padding:9px 13px;border-radius:11px;background:var(--card2);border:1px solid var(--line);color:var(--text);text-decoration:none;font-weight:800}
.profile-social-nav a:hover{border-color:var(--brand);transform:translateY(-1px)}
.profile-friends-panel{margin-top:16px}.friend-card{display:grid;grid-template-columns:44px minmax(0,1fr) auto auto;gap:9px;align-items:center;padding:9px;border-bottom:1px solid var(--line)}.friend-card:last-child{border-bottom:0}.friend-card>div{min-width:0}.friend-card small{display:block;color:var(--muted);font-size:11px}.friend-card .wall-avatar{width:44px;height:44px}
.user-badge{gap:3px;padding:3px 7px!important;border-radius:999px!important;background:color-mix(in srgb,var(--badge-color,var(--brand)) 12%,var(--card2))!important;border:1px solid color-mix(in srgb,var(--badge-color,var(--brand)) 35%,var(--line))!important;color:var(--text)!important;font-size:14px!important;white-space:nowrap}.user-badge small{font-size:10px;font-weight:850;color:var(--badge-color,var(--muted))}.user-badge small{font-size:10px;font-weight:800;color:var(--muted)}
.online-widget{position:relative}.online-toggle{border:1px solid var(--line);cursor:pointer;background:var(--card2);color:var(--text);border-radius:999px;padding:8px 12px;font-weight:850}.online-panel{position:absolute;right:0;top:calc(100% + 8px);width:min(360px,calc(100vw - 28px));max-height:420px;overflow:auto;padding:12px;border:1px solid var(--line);border-radius:18px;background:var(--card);box-shadow:0 18px 50px rgba(0,0,0,.25);z-index:300}.online-panel-head{display:flex;justify-content:space-between;gap:8px;padding-bottom:9px;border-bottom:1px solid var(--line)}.online-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;margin:9px 0}.online-stats span{padding:8px;border-radius:10px;background:var(--card2);font-size:11px;text-align:center}.online-stats b{display:block;font-size:15px}.online-users{display:grid;gap:3px}.online-users>a{display:flex;align-items:center;gap:9px;padding:7px;border-radius:11px;color:var(--text);text-decoration:none}.online-users>a:hover{background:var(--card2)}.online-mini-avatar{width:34px;height:34px;min-width:34px;border-radius:50%;overflow:hidden;display:grid;place-items:center;background:var(--card2)}.online-mini-avatar img{width:100%;height:100%;object-fit:cover}.online-users small{display:block;color:var(--muted);font-size:10px}
.pinned-bar{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.pinned-info{min-width:0;flex:1}.pinned-info span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pinned-actions{display:flex;gap:6px;flex-wrap:wrap}.pinned-actions button{border:1px solid var(--line);border-radius:10px;padding:8px 10px;cursor:pointer;font-weight:800;background:var(--card2);color:var(--text)}.pinned-actions .pinned-go{background:var(--brand);color:#fff;border-color:var(--brand)}.pinned-actions .pinned-unpin:hover{border-color:#f59e0b}.pinned-actions .pinned-delete:hover{border-color:#dc2626;color:#dc2626}
.chat-page #messages .quick-reactions{display:flex!important;opacity:0!important;visibility:hidden!important;pointer-events:none!important;transform:translateY(5px) scale(.96)!important}.chat-page #messages .message:hover .quick-reactions,.chat-page #messages .message:focus-within .quick-reactions,.chat-page #messages .message.tools-open .quick-reactions{opacity:1!important;visibility:visible!important;pointer-events:auto!important;transform:none!important}.chat-page #messages .quick-emoji-launch{display:none!important}
@media(max-width:700px){.profile-social-nav{overflow-x:auto;flex-wrap:nowrap}.profile-social-nav a{flex:0 0 auto}.friend-card{grid-template-columns:40px minmax(0,1fr) auto}.friend-card .profile-btn.primary{grid-column:3}.online-panel{right:-6px}.online-stats{grid-template-columns:1fr 1fr 1fr}.pinned-actions{width:100%}.pinned-actions button{flex:1;min-width:0}.pinned-info{width:calc(100% - 40px)}}
.forum-new-badge,.ann-new-badge,.market-new-badge{position:absolute!important;top:-6px;right:-5px;z-index:25;display:inline-flex;align-items:center;justify-content:center;min-width:20px;height:20px;padding:0 5px;border-radius:999px;background:#e11d48;color:#fff!important;font:800 10px/20px Arial,sans-serif;border:2px solid var(--card,#fff);box-sizing:border-box;white-space:nowrap;pointer-events:none}
@media(max-width:700px){.forum-new-badge,.ann-new-badge,.market-new-badge{top:0;right:2px;min-width:18px;height:18px;line-height:18px;font-size:9px}.mobile-nav .forum-new-badge,.mobile-nav .ann-new-badge,.mobile-nav .market-new-badge{top:-1px;right:calc(50% - 26px)}}


/* v107 targeted fixes: readable names, uncut emoji reactions, contained badges, profile navigation */
.chat-page #messages .message.me .chat-userline b,
.chat-page #messages .message.me .msg-head b,
.chat-page #messages .message.me .chat-userline .chat-user-link,
.chat-page #messages .message.me .msg-head .chat-user-link{color:#fff!important;text-shadow:0 1px 2px rgba(0,0,0,.35)!important;}
.chat-page #messages .message.me .chat-userline small,
.chat-page #messages .message.me .msg-head small{color:rgba(255,255,255,.82)!important;opacity:1!important;}
.chat-page #messages .quick-reactions{overflow:visible!important;clip-path:none!important;contain:none!important;}
.chat-page #messages .quick-reactions .reaction{overflow:visible!important;clip-path:none!important;contain:none!important;font-family:"Noto Color Emoji","Segoe UI Emoji",Arial,sans-serif!important;font-size:22px!important;line-height:1!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;}
.chat-page #messages .msg-hover-tools{overflow:visible!important;contain:none!important;}
.online-panel .online-users>a span:not(.online-mini-avatar){min-width:0!important;color:#172033!important;}
body.dark .online-panel .online-users>a span:not(.online-mini-avatar),
html[data-theme="dark"] .online-panel .online-users>a span:not(.online-mini-avatar){color:#f8fafc!important;}
.online-panel .online-users>a b{color:inherit!important;font-weight:850!important;text-shadow:none!important;}
.topnav a[href="notifications.php"],.mobile-nav a[href="notifications.php"]{min-width:32px;}
.topnav a[href="notifications.php"] .global-notify-badge,.mobile-nav a[href="notifications.php"] .global-notify-badge{right:0!important;top:0!important;transform:translate(0,0)!important;max-width:34px!important;overflow:hidden!important;}
.profile-back{display:inline-flex;align-items:center;gap:6px;margin-left:auto;padding:7px 10px;border:1px solid var(--line);border-radius:10px;background:var(--card2);color:var(--text);text-decoration:none;font-weight:800;font-size:12px;white-space:nowrap;}
.profile-back:hover{border-color:var(--brand);transform:translateY(-1px)}
.profile-modern .profile-story-block,.profile-modern .profile-wall,.profile-modern .profile-friends-panel,.profile-modern .messages-panel{position:relative!important;display:block!important;float:none!important;clear:both!important;inset:auto!important;transform:none!important;min-height:0!important;}
.profile-modern .profile-story-block{margin-top:16px!important;}
@media(max-width:700px){
 .profile-back{margin-left:0;font-size:11px;padding:6px 9px;}
 .panel-title{min-width:0;display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;}
 .chat-page #messages .message.me .chat-userline b,.chat-page #messages .message.me .msg-head b{font-size:13px!important;}
 .chat-page #messages .quick-reactions .reaction{font-size:21px!important;width:36px!important;min-width:36px!important;height:36px!important;}
 .online-panel{right:0!important;max-width:calc(100vw - 20px)!important;}
}
/* Instagram-like active story ring around the main profile avatar. */
.profile-modern .avatar-wrap.has-story .profile-avatar-xl{border:5px solid transparent!important;background:linear-gradient(var(--card),var(--card)) padding-box,linear-gradient(135deg,#ff7a00,#ff0069,#8a2be2) border-box!important;box-shadow:0 0 0 3px rgba(255,0,105,.14),0 14px 36px rgba(0,0,0,.2)!important;}

/* v110: fix profile friends header overlap */
.profile-modern .profile-friends-panel .panel-title{display:flex!important;align-items:flex-start!important;justify-content:space-between!important;gap:14px!important;flex-wrap:wrap!important;min-width:0!important;}
.profile-modern .profile-friends-panel .panel-title>div{flex:1 1 220px!important;min-width:0!important;}
.profile-modern .profile-friends-panel .panel-title>div h2{margin:4px 0 0!important;line-height:1.2!important;}
.profile-modern .profile-friends-panel .panel-title>span{display:flex!important;align-items:center!important;justify-content:flex-end!important;gap:6px!important;flex:0 1 auto!important;min-width:0!important;}
.profile-modern .profile-friends-panel .panel-title .profile-btn{display:inline-flex!important;align-items:center!important;justify-content:center!important;}
@media(max-width:700px){
 .profile-modern .profile-friends-panel .panel-title{gap:10px!important;}
 .profile-modern .profile-friends-panel .panel-title>div{flex-basis:100%!important;}
 .profile-modern .profile-friends-panel .panel-title>span{width:100%!important;justify-content:flex-start!important;flex-wrap:wrap!important;}
}

/* v111: keep the desktop/mobile notification badge inside the bell link. */
.topnav a[href="notifications.php"],
.mobile-nav a[href="notifications.php"]{position:relative!important;overflow:visible!important;}
.topnav a[href="notifications.php"] .global-notify-badge,
.mobile-nav a[href="notifications.php"] .global-notify-badge{right:4px!important;top:4px!important;transform:none!important;max-width:34px!important;overflow:hidden!important;}
/* v111: quick reactions have no enclosing border; individual emoji buttons remain clickable. */
.chat-page #messages .quick-reactions{border:0!important;outline:0!important;}

/* v113 — notification badge must stay physically inside the notification button/site bounds. */
.topnav a[href="notifications.php"]{
  position:relative!important;
  flex:0 0 42px!important;
  width:42px!important;
  min-width:42px!important;
  height:38px!important;
  padding:8px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  overflow:hidden!important;
}
.topnav a[href="notifications.php"] .global-notify-badge{
  position:absolute!important;
  top:2px!important;
  right:2px!important;
  left:auto!important;
  bottom:auto!important;
  transform:none!important;
  max-width:30px!important;
  min-width:18px!important;
  height:18px!important;
  padding:0 4px!important;
  border:1px solid var(--card,#fff)!important;
  box-sizing:border-box!important;
  overflow:hidden!important;
  white-space:nowrap!important;
  z-index:5!important;
}
.mobile-nav a[href="notifications.php"]{
  position:relative!important;
  overflow:hidden!important;
}
.mobile-nav a[href="notifications.php"] .global-notify-badge{
  top:1px!important;
  right:calc(50% - 20px)!important;
  left:auto!important;
  transform:none!important;
  max-width:28px!important;
  min-width:18px!important;
  height:18px!important;
  padding:0 4px!important;
  z-index:5!important;
}
@media(max-width:700px){
  .topnav a[href="notifications.php"]{flex:0 0 38px!important;width:38px!important;min-width:38px!important;height:34px!important;padding:6px!important;}
  .topnav a[href="notifications.php"] .global-notify-badge{top:1px!important;right:1px!important;max-width:27px!important;min-width:17px!important;height:17px!important;font-size:9px!important;}
}

/* ===== v114 PROFILE RESPONSIVE LAYOUT ===== */
.profile-modern .profile-shell{width:100%;max-width:1180px;margin-left:auto;margin-right:auto;box-sizing:border-box;}
.profile-modern .profile-card{width:100%;max-width:100%;overflow:visible!important;}
.profile-modern .profile-content{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(270px,310px)!important;align-items:start!important;gap:18px!important;width:100%;box-sizing:border-box;}
.profile-modern .profile-main-col,.profile-modern .profile-side{width:100%;min-width:0;max-width:100%;align-self:start;}
.profile-modern .profile-main-col{display:grid;gap:16px;}
.profile-modern .profile-side{display:grid;gap:16px;}
.profile-modern .profile-panel{width:100%;box-sizing:border-box;}
.profile-modern .quick-panel{height:auto!important;min-height:0!important;overflow:visible!important;}
.profile-modern .quick-panel a{min-width:0;box-sizing:border-box;align-items:center;}
.profile-modern .quick-panel a span{flex:0 0 auto;}
.profile-modern .profile-story-block,.profile-modern .profile-wall,.profile-modern .profile-friends-panel,.profile-modern .messages-panel{width:100%;box-sizing:border-box;}
.profile-modern .profile-story-block{overflow:visible!important;}
.profile-modern .story-tray{min-width:0;max-width:100%;}
.profile-modern .profile-friends-panel{overflow:visible!important;}
.profile-modern .profile-friends-panel #profileFriends{width:100%;min-width:0;}
.profile-modern .friend-card{width:100%;min-width:0;box-sizing:border-box;grid-template-columns:44px minmax(120px,1fr) auto auto;}
.profile-modern .friend-card .profile-btn{max-width:100%;box-sizing:border-box;}
.profile-modern .profile-friends-panel .panel-title>span{max-width:100%;}
.profile-modern .profile-head{grid-template-columns:auto minmax(0,1fr) minmax(220px,auto);min-width:0;}
.profile-modern .profile-title{min-width:0;}
.profile-modern .profile-head-actions{min-width:0;max-width:100%;justify-content:flex-end;flex-wrap:wrap;}
.profile-modern .profile-head-actions .profile-btn{max-width:100%;}

@media (max-width:1050px) and (min-width:701px){
  .profile-modern .profile-shell{padding-left:12px;padding-right:12px;}
  .profile-modern .profile-content{grid-template-columns:minmax(0,1fr) 270px!important;gap:12px!important;padding:14px!important;}
  .profile-modern .profile-head{grid-template-columns:auto minmax(0,1fr);}
  .profile-modern .profile-head-actions{grid-column:1/-1;justify-content:flex-start;padding-top:2px;}
  .profile-modern .profile-head-actions .profile-btn{flex:0 1 auto;}
  .profile-modern .friend-card{grid-template-columns:42px minmax(100px,1fr) auto auto;}
}

@media (max-width:900px) and (min-width:701px){
  .profile-modern .profile-content{grid-template-columns:1fr!important;}
  .profile-modern .profile-side{grid-template-columns:repeat(2,minmax(0,1fr));}
  .profile-modern .profile-side .profile-panel{height:auto;}
}

@media (max-width:700px){
  .profile-modern .profile-shell{width:100%;padding:8px 8px 70px!important;margin:0!important;}
  .profile-modern .profile-card{border-radius:18px!important;}
  .profile-modern .profile-cover{height:150px!important;}
  .profile-modern .profile-head{display:grid!important;grid-template-columns:1fr!important;gap:9px!important;padding:0 12px 14px!important;margin-top:-42px!important;align-items:start!important;}
  .profile-modern .avatar-wrap{justify-self:start;}
  .profile-modern .profile-avatar-xl{width:104px!important;height:104px!important;min-width:104px!important;min-height:104px!important;flex-basis:104px!important;}
  .profile-modern .profile-title{width:100%;padding:0!important;}
  .profile-modern .profile-title h1{font-size:23px!important;line-height:1.15!important;overflow-wrap:anywhere;word-break:break-word;}
  .profile-modern .profile-status-row{flex-wrap:wrap!important;line-height:1.35!important;}
  .profile-modern .profile-title p{max-width:100%;}
  .profile-modern .profile-head-actions{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;width:100%!important;gap:6px!important;padding:0!important;}
  .profile-modern .profile-head-actions .profile-btn{width:100%!important;min-width:0!important;white-space:normal!important;padding:9px 6px!important;}
  .profile-modern .profile-social-nav{width:100%;box-sizing:border-box;overflow-x:auto;overflow-y:hidden;flex-wrap:nowrap!important;padding:8px!important;margin:9px 0!important;}
  .profile-modern .profile-content{display:grid!important;grid-template-columns:1fr!important;width:100%!important;padding:0!important;gap:10px!important;}
  .profile-modern .profile-main-col,.profile-modern .profile-side{display:grid!important;grid-template-columns:1fr!important;width:100%!important;gap:10px!important;}
  .profile-modern .profile-panel{width:100%!important;max-width:100%!important;padding:12px!important;border-radius:15px!important;overflow:visible!important;}
  .profile-modern .profile-stats{grid-template-columns:repeat(2,minmax(0,1fr))!important;width:100%;}
  .profile-modern .profile-stats .stat-link{min-width:0!important;overflow-wrap:anywhere;}
  .profile-modern .profile-tabs-single{width:100%;box-sizing:border-box;}
  .profile-modern .profile-story-block{margin:10px 0!important;}
  .profile-modern .profile-story-block .panel-title,
  .profile-modern .profile-wall .panel-title,
  .profile-modern .profile-friends-panel .panel-title,
  .profile-modern .messages-panel .panel-title{display:flex!important;align-items:flex-start!important;justify-content:space-between!important;gap:8px!important;flex-wrap:wrap!important;}
  .profile-modern .profile-story-block .panel-title>div,
  .profile-modern .profile-wall .panel-title>div,
  .profile-modern .profile-friends-panel .panel-title>div,
  .profile-modern .messages-panel .panel-title>div{flex:1 1 150px!important;min-width:0!important;}
  .profile-modern .profile-story-block .panel-title>span,
  .profile-modern .profile-friends-panel .panel-title>span,
  .profile-modern .messages-panel .panel-title>span{width:100%!important;justify-content:flex-start!important;}
  .profile-modern .profile-friends-panel .panel-title .profile-btn,
  .profile-modern .messages-panel .panel-title .profile-btn{white-space:normal!important;}
  .profile-modern .friend-card{grid-template-columns:40px minmax(0,1fr)!important;gap:8px!important;padding:9px 4px!important;}
  .profile-modern .friend-card .profile-btn{grid-column:2!important;justify-self:start!important;}
  .profile-modern .friend-card>button:last-child{grid-column:2!important;justify-self:start!important;}
  .profile-modern .quick-panel a{padding:12px 0!important;min-height:44px;}
  .profile-modern .quick-panel h2{margin-bottom:4px;}
  .profile-modern .edit-grid{grid-template-columns:1fr!important;gap:12px!important;}
  .profile-modern .edit-avatar{width:100%;}
  .profile-modern .edit-contact-grid{grid-template-columns:1fr!important;}
  .profile-modern .edit-contact-grid .full{grid-column:auto!important;}
  .profile-modern .conversation-row{min-width:0;}
}

@media (max-width:430px){
  .profile-modern .profile-shell{padding-left:6px!important;padding-right:6px!important;}
  .profile-modern .profile-cover{height:130px!important;}
  .profile-modern .profile-head{padding-left:9px!important;padding-right:9px!important;}
  .profile-modern .profile-head-actions{grid-template-columns:1fr!important;}
  .profile-modern .profile-stats{gap:6px!important;}
  .profile-modern .profile-stats .stat-link{padding:10px 7px!important;}
  .profile-modern .profile-panel{padding:10px!important;}
  .profile-modern .friend-card{grid-template-columns:38px minmax(0,1fr)!important;}
  .profile-modern .friend-card .wall-avatar{width:38px!important;height:38px!important;min-width:38px!important;}
}

/* ===== v115 CHAT SCROLLBAR ===== */
.chat-page #messages{
  scrollbar-width:thin!important;
  scrollbar-color:rgba(70,170,255,.72) rgba(255,255,255,.06)!important;
  scrollbar-gutter:stable!important;
}
.chat-page #messages::-webkit-scrollbar{
  width:11px!important;
}
.chat-page #messages::-webkit-scrollbar-track{
  background:rgba(255,255,255,.045)!important;
  border:1px solid rgba(120,190,255,.12)!important;
  border-radius:999px!important;
  margin:8px 3px!important;
  box-shadow:inset 0 0 8px rgba(0,0,0,.18)!important;
}
.chat-page #messages::-webkit-scrollbar-thumb{
  background:linear-gradient(180deg,rgba(93,200,255,.9),rgba(37,99,235,.88))!important;
  border:2px solid rgba(8,20,35,.58)!important;
  border-radius:999px!important;
  min-height:48px!important;
  box-shadow:0 0 10px rgba(56,189,248,.28)!important;
}
.chat-page #messages::-webkit-scrollbar-thumb:hover{
  background:linear-gradient(180deg,rgba(125,211,252,1),rgba(59,130,246,1))!important;
  box-shadow:0 0 14px rgba(56,189,248,.48)!important;
}
.chat-page #messages::-webkit-scrollbar-button{
  display:none!important;
  width:0!important;
  height:0!important;
}
@media(max-width:700px){
  .chat-page #messages{
    scrollbar-width:thin!important;
  }
  .chat-page #messages::-webkit-scrollbar{width:7px!important;}
  .chat-page #messages::-webkit-scrollbar-track{margin:6px 2px!important;}
  .chat-page #messages::-webkit-scrollbar-thumb{border-width:1px!important;min-height:42px!important;}
}

/* ===== v116 profile internal sections + responsive cleanup ===== */
.profile-modern .profile-section-nav a.active{background:var(--brand);color:#fff;border-color:var(--brand);box-shadow:0 8px 20px rgba(217,4,41,.18)}
.profile-modern .profile-section-view,
.profile-modern .profile-story-block,
.profile-modern .profile-wall,
.profile-modern .profile-friends-panel,
.profile-modern .messages-panel{scroll-margin-top:18px}
.profile-modern .profile-section-nav~.profile-story-block,
.profile-modern .profile-section-nav~.profile-wall,
.profile-modern .profile-section-nav~.profile-friends-panel,
.profile-modern .profile-section-nav~.profile-content,
.profile-modern .profile-section-nav~.messages-panel{display:none!important}
.profile-modern .profile-section-nav~.profile-story-block.profile-section-active,
.profile-modern .profile-section-nav~.profile-wall.profile-section-active,
.profile-modern .profile-section-nav~.profile-friends-panel.profile-section-active,
.profile-modern .profile-section-nav~.profile-content.profile-section-active,
.profile-modern .profile-section-nav~.messages-panel.profile-section-active{display:block!important}
.profile-modern .profile-section-nav~.profile-content.profile-section-active{display:grid!important}
.profile-modern .profile-friends-panel .panel-title>span{display:flex;align-items:center;gap:8px;flex-wrap:wrap;min-width:0}
.profile-modern .friend-card{min-width:0;box-sizing:border-box;overflow:hidden}
.profile-modern .friend-card .profile-btn{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.profile-modern .quick-panel{overflow:hidden!important}
.profile-modern .quick-panel a{min-width:0;box-sizing:border-box;overflow:hidden}
.profile-modern .quick-panel a span{white-space:nowrap}
.profile-modern .profile-side{min-width:0}
@media(max-width:700px){
  .profile-modern .profile-section-nav{position:sticky;top:0;z-index:15;background:var(--card);box-shadow:0 6px 18px rgba(0,0,0,.12)}
  .profile-modern .profile-section-nav a{padding:9px 11px;font-size:12px}
  .profile-modern .friend-card{grid-template-columns:40px minmax(0,1fr)!important;overflow:visible}
  .profile-modern .friend-card .profile-btn{max-width:100%;white-space:normal;justify-self:start}
  .profile-modern .profile-friends-panel .panel-title>span{width:100%;justify-content:flex-start}
  .profile-modern .quick-panel a{white-space:normal;overflow-wrap:anywhere;min-height:46px}
  .profile-modern .quick-panel a span{white-space:nowrap}
}

/* Online list: strong readable nicknames on both themes. */
.online-panel .online-users>a span:not(.online-mini-avatar){min-width:0;color:#0f172a!important;font-weight:700!important}
.online-panel .online-users>a b{display:block;color:#0f172a!important;font-size:14px!important;font-weight:900!important;line-height:1.2}
.online-panel .online-users>a small{display:block;color:#475569!important;font-size:11px!important;line-height:1.25;margin-top:2px}
body.dark .online-panel .online-users>a span:not(.online-mini-avatar),
html[data-theme="dark"] .online-panel .online-users>a span:not(.online-mini-avatar){color:#f8fafc!important}
body.dark .online-panel .online-users>a b,
html[data-theme="dark"] .online-panel .online-users>a b{color:#fff!important}
body.dark .online-panel .online-users>a small,
html[data-theme="dark"] .online-panel .online-users>a small{color:#cbd5e1!important}

/* Notification counter stays inside its bell without changing notification logic. */
.topnav a[href="notifications.php"]{position:relative!important;overflow:hidden!important;contain:paint!important}
.topnav a[href="notifications.php"] .global-notify-badge{right:2px!important;top:2px!important;transform:none!important;max-width:calc(100% - 4px)!important}

/* v119 — isolated site template pack */
.site-theme-ocean{--theme-bg:#eef8ff;--theme-a:#0284c7;--theme-b:#2563eb;--theme-r:20px}
.site-theme-messenger{--theme-bg:#f4f7fb;--theme-a:#2563eb;--theme-b:#4f46e5;--theme-r:17px}
.site-theme-dark{--theme-bg:#070d18;--theme-a:#38bdf8;--theme-b:#6366f1;--theme-r:18px}
.site-theme-glass{--theme-bg:#dfeffc;--theme-a:#0284c7;--theme-b:#7c3aed;--theme-r:24px}
.site-theme-modern{--theme-bg:#f7f8fa;--theme-a:#111827;--theme-b:#2563eb;--theme-r:14px}
body.site-theme-ocean,body.site-theme-messenger,body.site-theme-dark,body.site-theme-glass,body.site-theme-modern{background-color:var(--theme-bg);background-image:none}
body.site-theme-ocean{background-image:radial-gradient(circle at 10% 0,rgba(56,189,248,.24),transparent 32%),radial-gradient(circle at 90% 10%,rgba(14,165,233,.16),transparent 28%)}
body.site-theme-dark{color:#e5edf8;background-image:radial-gradient(circle at 10% 0,rgba(56,189,248,.12),transparent 30%),radial-gradient(circle at 90% 0,rgba(99,102,241,.13),transparent 30%)}
body.site-theme-glass{background-image:radial-gradient(circle at 15% 10%,rgba(14,165,233,.28),transparent 32%),radial-gradient(circle at 85% 20%,rgba(124,58,237,.20),transparent 34%),linear-gradient(135deg,#dbeafe,#eef2ff 50%,#cffafe)}
body.site-theme-modern{background-image:linear-gradient(180deg,#f8fafc,#f3f4f6)}
.site-theme-glass .card,.site-theme-glass .chatbox,.site-theme-glass .users-panel,.site-theme-glass .forum-card,.site-theme-glass .topic-list,.site-theme-glass .profile-card,.site-theme-glass .admin-card,.site-theme-glass .rules-card{background:rgba(255,255,255,.54);border-color:rgba(255,255,255,.62);backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px)}
.site-theme-modern .card,.site-theme-modern .chatbox,.site-theme-modern .users-panel,.site-theme-modern .forum-card,.site-theme-modern .topic-list,.site-theme-modern .profile-card,.site-theme-modern .admin-card,.site-theme-modern .rules-card{border-radius:var(--theme-r);box-shadow:0 8px 28px rgba(15,23,42,.06)}
.site-theme-messenger .message-body,.site-theme-messenger .msg-body{border-radius:18px 18px 18px 7px;box-shadow:0 3px 12px rgba(15,23,42,.05)}
.site-theme-messenger .me .message-body,.site-theme-messenger .me .msg-body{border-radius:18px 18px 7px 18px}
.site-theme-ocean .composer button,.site-theme-messenger .composer button,.site-theme-glass .composer button{background:linear-gradient(135deg,var(--theme-a),var(--theme-b))}
.site-theme-dark header{background:rgba(7,13,24,.88);border-color:#26344b}
.site-theme-dark .card,.site-theme-dark .chatbox,.site-theme-dark .users-panel,.site-theme-dark .forum-card,.site-theme-dark .topic-list,.site-theme-dark .profile-card,.site-theme-dark .admin-card,.site-theme-dark .rules-card{background:rgba(15,23,42,.94);border-color:#26344b;color:#e5edf8}
.site-theme-dark input,.site-theme-dark textarea,.site-theme-dark select,.site-theme-dark .composer,.site-theme-dark .chat-tools{background:#0b1322;color:#e5edf8;border-color:#26344b}
.site-theme-dark .secondary,.site-theme-dark .quick-btn,.site-theme-dark .topnav a,.site-theme-dark .theme-btn{background:#111c2e;color:#dbeafe;border-color:#26344b}
.site-theme-dark .message-body,.site-theme-dark .msg-body{background:#111c2e;border-color:#26344b}
.site-theme-dark .me .message-body,.site-theme-dark .me .msg-body{background:linear-gradient(135deg,#0284c7,#4f46e5)}
.site-theme-dark h1,.site-theme-dark h2,.site-theme-dark h3,.site-theme-dark b,.site-theme-dark .brand{color:#f8fafc}
.site-theme-dark .muted,.site-theme-dark .hero p,.site-theme-dark .page-head p{color:#94a3b8}
.site-theme-glass .message-body,.site-theme-glass .msg-body{background:rgba(255,255,255,.68);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px)}
.site-theme-glass .me .message-body,.site-theme-glass .me .msg-body{background:linear-gradient(135deg,rgba(2,132,199,.92),rgba(124,58,237,.88))}
html.theme-motion-off *,html.theme-motion-off *::before,html.theme-motion-off *::after{animation-duration:0s!important;animation-delay:0s!important;transition:none!important;scroll-behavior:auto!important}
html[data-theme-density="compact"] .card,html[data-theme-density="compact"] .forum-card,html[data-theme-density="compact"] .topic-list{padding:14px}
html[data-theme-density="spacious"] .card,html[data-theme-density="spacious"] .forum-card,html[data-theme-density="spacious"] .topic-list{padding:24px}
html[data-theme-rounding="sharp"]{--r:10px}html[data-theme-rounding="medium"]{--r:18px}html[data-theme-rounding="round"]{--r:28px}
.site-theme-glass header{background:rgba(255,255,255,.48);backdrop-filter:blur(22px);-webkit-backdrop-filter:blur(22px)}
@media(max-width:700px){.site-theme-glass .card,.site-theme-glass .chatbox,.site-theme-glass .users-panel{backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px)}}
html[data-theme-glass="off"] .site-theme-glass .card,html[data-theme-glass="off"] .site-theme-glass .chatbox,html[data-theme-glass="off"] .site-theme-glass .users-panel,html[data-theme-glass="off"] .site-theme-glass .forum-card,html[data-theme-glass="off"] .site-theme-glass .topic-list{backdrop-filter:none;-webkit-backdrop-filter:none;background:rgba(255,255,255,.94)}
html[data-theme-glass="strong"] .site-theme-glass .card,html[data-theme-glass="strong"] .site-theme-glass .chatbox,html[data-theme-glass="strong"] .site-theme-glass .users-panel,html[data-theme-glass="strong"] .site-theme-glass .forum-card,html[data-theme-glass="strong"] .site-theme-glass .topic-list{background:rgba(255,255,255,.40);backdrop-filter:blur(24px);-webkit-backdrop-filter:blur(24px)}


/* v120 targeted fixes: mobile own-message emphasis, story avatars, online names, admin crown */
.admin-badge{display:inline-flex!important;align-items:center!important;justify-content:center!important;vertical-align:middle!important;line-height:1!important;height:1.15em!important;margin:0 3px 0 0!important;position:relative!important;top:0!important;transform:none!important;flex:0 0 auto!important}
.chat-userline>span,.msg-head>span{align-items:baseline!important}
.message.me .chat-userline b,.message.me .msg-head b{color:#fff!important}
@media(max-width:700px){
  .message.me .chat-bubble{background:linear-gradient(135deg,rgba(37,99,235,.98),rgba(29,78,216,.98))!important;box-shadow:0 5px 18px rgba(37,99,235,.22),0 0 0 1px rgba(96,165,250,.22)!important}
  .message.me .chat-userline b,.message.me .msg-head b{color:#fff!important;text-shadow:0 1px 2px rgba(0,0,0,.22)!important}
  .message.me .reply-preview{background:rgba(255,255,255,.16)!important;border-left-color:rgba(255,255,255,.9)!important}
  .v27-emoji-panel{touch-action:pan-y!important;overscroll-behavior:contain!important;-webkit-user-select:none!important;user-select:none!important}
  .v27-emoji-panel .emoji-item{touch-action:pan-y!important;-webkit-user-select:none!important;user-select:none!important}
}
.profile-modern .profile-avatar-xl,.profile-modern .profile-avatar-xl img,.profile-modern .profile-avatar-xl>span{border-radius:50%!important;overflow:hidden!important}
.profile-modern .avatar-wrap{border-radius:50%!important}
.profile-modern .avatar-wrap.has-story .profile-avatar-xl{border:4px solid transparent!important;background:linear-gradient(var(--card),var(--card)) padding-box,linear-gradient(135deg,#ff7a00,#ff0069,#8a2be2) border-box!important;box-shadow:0 0 0 3px rgba(255,0,105,.14),0 10px 30px rgba(0,0,0,.2)!important}
.profile-modern .profile-section-nav a.active{font-weight:900!important}
.story-page{background:radial-gradient(circle at 20% 10%,rgba(37,99,235,.22),transparent 35%),linear-gradient(180deg,#10283a,#07131b)!important}
.story-page #storyApp{background:transparent!important}
.story-view{background:rgba(10,28,42,.92)!important}
.story-media-error{padding:28px;text-align:center;color:#fff;font-weight:800;line-height:1.6}
.story-media-error small{opacity:.75;font-weight:500}

/* v121 — hard overflow protection: layout only, no feature logic changes */
*,*::before,*::after{box-sizing:border-box}
html{max-width:100%;overflow-x:hidden}
body{width:100%;max-width:100%;min-width:0;overflow-x:hidden}
img,video,canvas,svg,iframe{max-width:100%;height:auto}
input,textarea,select,button{max-width:100%;box-sizing:border-box}
button{white-space:normal;overflow-wrap:anywhere}
input,textarea,select{min-width:0}
main,header,footer,section,article,aside,nav,.container,.wrap,.page,.content,.content-wrap,.main,.layout,.grid,.card,.panel,.chatbox,.forum-card,.topic-list,.profile-card,.admin-card{min-width:0;max-width:100%}
.card,.panel,.chatbox,.forum-card,.topic-list,.profile-card,.admin-card,.message,.message-row,.chat-row,.friend-card,.market-item,.announcement-card,.notification-item{overflow-wrap:anywhere;word-break:break-word}
.topnav,.nav,.tabs,.profile-section-nav,.actions,.button-row,.form-actions,.chat-tools,.composer,.filters,.category-tabs{min-width:0;max-width:100%}
.topnav a,.nav a,.tabs a,.profile-section-nav a,.actions a,.actions button,.button-row button,.form-actions button,.chat-tools button,.composer button,.filters button,.category-tabs a{min-width:0;max-width:100%;white-space:normal;overflow-wrap:anywhere}
/* Keep ordinary flex/grid children shrinkable instead of forcing horizontal overflow. */
.flex,.row,.topbar,.header-inner,.content-grid,.profile-grid,.admin-grid,.message-row,.chat-row,.friend-card{min-width:0}
.flex>* ,.row>* ,.topbar>* ,.header-inner>* ,.content-grid>* ,.profile-grid>* ,.admin-grid>* ,.message-row>* ,.chat-row>* ,.friend-card>*{min-width:0;max-width:100%}
@media(max-width:900px){
  .container,.wrap,.page,.content,.content-wrap,main{width:100%;max-width:100%;padding-left:max(10px,env(safe-area-inset-left));padding-right:max(10px,env(safe-area-inset-right))}
  .topnav,.nav,.tabs,.profile-section-nav{max-width:100%;overflow-x:auto;overflow-y:hidden;scrollbar-width:thin}
  .topnav a,.nav a,.tabs a,.profile-section-nav a{flex:0 0 auto}
  .card,.panel,.chatbox,.forum-card,.topic-list,.profile-card,.admin-card{width:100%;max-width:100%;overflow-x:hidden}
  .message,.message-row,.chat-row,.friend-card,.market-item,.announcement-card,.notification-item{max-width:100%}
  .message-body,.msg-body,.chat-bubble,.reply-preview{max-width:100%;min-width:0;overflow-wrap:anywhere;word-break:break-word}
  .composer,.chat-tools,.form-actions,.button-row,.actions{width:100%;max-width:100%;min-width:0;flex-wrap:wrap}
  .composer>* ,.chat-tools>* ,.form-actions>* ,.button-row>* ,.actions>*{min-width:0;max-width:100%}
  .profile-modern .profile-head,.profile-modern .profile-actions,.profile-modern .profile-stats,.profile-modern .profile-section-nav{max-width:100%;min-width:0}
  .profile-modern .profile-head>* ,.profile-modern .profile-actions>* ,.profile-modern .profile-stats>*{min-width:0;max-width:100%}
}
@media(max-width:480px){
  .container,.wrap,.page,.content,.content-wrap,main{padding-left:max(8px,env(safe-area-inset-left));padding-right:max(8px,env(safe-area-inset-right))}
  h1,h2,h3,h4,p,small,b,strong,span,a,label,legend{overflow-wrap:anywhere}
  .topnav a,.nav a,.tabs a,.profile-section-nav a{max-width:85vw}
  .button-row button,.form-actions button,.actions button,.actions a{max-width:100%}
}
/* Tables and preformatted content are the common remaining overflow sources. */
table{width:100%;max-width:100%;border-collapse:collapse;table-layout:fixed}
th,td{min-width:0;max-width:100%;overflow-wrap:anywhere;word-break:break-word}
pre,code{max-width:100%;white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word}

/* v122 requested UI polish: compact mobile chat, conversation delete, top-nav appearance */
.topnav a{color:var(--top-nav-text,#475569);border:1px solid transparent;transition:background .18s,border-color .18s,box-shadow .18s,color .18s,transform .18s}
html[data-top-nav-bg="soft"] .topnav a{background:rgba(37,99,235,.07);border-color:rgba(37,99,235,.10)}
html[data-top-nav-bg="strong"] .topnav a{background:rgba(37,99,235,.13);border-color:rgba(37,99,235,.18)}
html[data-top-nav-active="none"] .topnav a.active{background:transparent!important;border-color:transparent!important;color:var(--top-nav-text,#475569)!important;box-shadow:none!important}
html[data-top-nav-active="soft"] .topnav a.active{background:color-mix(in srgb,var(--top-nav-active,#2563eb) 14%,transparent);border-color:color-mix(in srgb,var(--top-nav-active,#2563eb) 30%,transparent);color:var(--top-nav-active,#2563eb)!important}
html[data-top-nav-active="strong"] .topnav a.active{background:var(--top-nav-active,#2563eb);border-color:var(--top-nav-active,#2563eb);color:#fff!important}
html[data-top-nav-radius="small"] .topnav a{border-radius:8px}
html[data-top-nav-radius="medium"] .topnav a{border-radius:12px}
html[data-top-nav-radius="round"] .topnav a{border-radius:999px}
html[data-top-nav-glow="on"] .topnav a:hover,html[data-top-nav-glow="on"] .topnav a.active{box-shadow:0 0 18px color-mix(in srgb,var(--top-nav-active,#2563eb) 28%,transparent)}
.topnav a:hover{transform:translateY(-1px)}
.conversation-row{display:flex;align-items:center;gap:8px;min-width:0;width:100%}
.conversation-row .conversation-open{display:flex;align-items:center;gap:12px;min-width:0;flex:1;text-decoration:none;color:inherit}
.conversation-delete{flex:0 0 auto;width:38px;height:38px;border:1px solid var(--line);border-radius:10px;background:var(--card2);cursor:pointer;display:grid;place-items:center;padding:0}
.conversation-delete:hover{background:#fee2e2;border-color:#fecaca}
@media(max-width:700px){
  .chat-page .chatbox{min-height:0!important}
  .chat-page #messages{padding:8px 5px 14px!important}
  .chat-page #messages .message{margin:5px 0!important;padding:0 3px!important}
  .chat-page #messages .chat-bubble{max-width:86%!important;padding:7px 9px 6px!important;border-radius:13px 13px 13px 5px!important}
  .chat-page #messages .message.me .chat-bubble{border-radius:13px 13px 5px 13px!important}
  .chat-page #messages .chat-bubble p{font-size:14px!important;line-height:1.34!important;margin:5px 0!important}
  .chat-page #messages .chat-userline b,.chat-page #messages .msg-head b{font-size:11.5px!important}
  .chat-page #messages .chat-userline small,.chat-page #messages .msg-head small{font-size:9.5px!important}
  .chat-page #messages .chat-userline .avatar,.chat-page #messages .msg-head .avatar{width:25px!important;height:25px!important;min-width:25px!important}
  .chat-page #messages .reply-preview{padding:5px 7px!important;margin:4px 0!important;border-radius:8px!important}
  .chat-page #messages .reply-preview p{font-size:10.5px!important;line-height:1.2!important;margin:1px 0!important}
  .chat-page #messages .msg-hover-tools{gap:3px!important;padding:3px!important;border-radius:9px!important}
  .chat-page #messages .msg-hover-tools .reaction,.chat-page #messages .msg-hover-tools .reply-btn{min-width:29px!important;height:28px!important;padding:3px 5px!important;font-size:13px!important}
  .chat-page #messages .msg-hover-tools .reaction small{font-size:9px!important}
  .chat-page .v27-composer-row{gap:3px!important}
  .chat-page .chat-tool-btn,.chat-page .v27-emoji-btn,.chat-page .v27-send{min-width:38px!important;width:38px!important;height:38px!important;min-height:38px!important;padding:5px!important}
  .chat-page .v27-composer-row textarea{min-height:38px!important;max-height:88px!important;padding:8px 9px!important;font-size:14px!important}
  .chat-page .v27-emoji-panel{left:8px!important;right:8px!important;bottom:48px!important;width:auto!important;max-height:38vh!important;padding:6px!important;gap:2px!important;grid-template-columns:repeat(8,minmax(0,1fr))!important;border-radius:14px!important}
  .chat-page .v27-emoji-panel .emoji-item{height:34px!important;min-height:34px!important;font-size:20px!important;padding:2px!important}
  .conversation-row{gap:5px}
  .conversation-delete{width:34px;height:34px;border-radius:9px}
}
.nav-appearance-settings{margin:14px 0;padding:14px;border:1px solid var(--line);border-radius:16px;background:var(--card2)}
.nav-appearance-settings h3{margin:0 0 10px}


/* v123 — requested header + persistent chat reactions. Isolated UI overrides only. */
/* Top navigation: keep the full notification label on one line. */
header .topnav a[href="notifications.php"]{
  width:auto!important;
  min-width:120px!important;
  flex:0 0 auto!important;
  white-space:nowrap!important;
  overflow:visible!important;
  text-overflow:clip!important;
  justify-content:center!important;
}
header .topnav a[href="notifications.php"] .global-notify-badge{
  max-width:none!important;
}
/* Do not show the optional search item or hamburger/menu controls in the site header. */
header .topnav a[href="search.php"],
header .topnav .search-btn,
header .topnav .search-toggle,
header .topnav .menu-btn,
header .topnav .menu-toggle,
header .topnav .hamburger,
header .topnav button[aria-label*="Меню"],
header .topnav button[title*="Меню"],
header .topnav button[aria-label*="menu"],
header .topnav button[title*="menu"]{
  display:none!important;
}
/* Persisted reaction chips are visible below the message, like the reference UI. */
.chat-page #messages .reactions{
  display:flex!important;
  flex-wrap:wrap!important;
  align-items:center!important;
  gap:5px!important;
  margin-top:8px!important;
  min-height:0!important;
}
.chat-page #messages .reactions:empty{display:none!important}
.chat-page #messages .reactions .reaction{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  min-width:34px!important;
  min-height:27px!important;
  padding:3px 8px!important;
  border:1px solid var(--line,#334155)!important;
  border-radius:999px!important;
  background:var(--card2,#172033)!important;
  color:var(--text,#e5e7eb)!important;
  cursor:pointer!important;
}
.chat-page #messages .reactions .reaction.active{
  border-color:rgba(37,99,235,.65)!important;
  background:rgba(37,99,235,.22)!important;
}
.chat-page #messages .reactions .reaction small{font-size:11px!important;margin-left:3px!important}
@media(max-width:700px){
  header .topnav a[href="notifications.php"]{min-width:110px!important;width:auto!important;font-size:12px!important;padding:7px 9px!important}
  .chat-page #messages .reactions{gap:3px!important;margin-top:5px!important}
  .chat-page #messages .reactions .reaction{min-width:30px!important;min-height:24px!important;padding:2px 7px!important;font-size:12px!important}
}

/* ===== v124 MOBILE CHAT COMPACT ===== */
@media (max-width:700px){
  .chat-page #siteWelcome,
  .chat-page #siteAd,
  .chat-page #pinnedRules{display:none!important;}
  .chat-page main{width:100%!important;margin:0!important;padding:0 0 4px!important;height:calc(100dvh - 122px)!important;min-height:0!important;display:flex!important;flex-direction:column!important;overflow:hidden!important;}
  .chat-page .hero{flex:0 0 auto!important;min-height:52px!important;height:52px!important;padding:5px 12px!important;margin:0!important;align-items:center!important;gap:8px!important;border-bottom:1px solid var(--line)!important;}
  .chat-page .hero > div:first-child{min-width:0!important;}
  .chat-page .hero .eyebrow{display:none!important;}
  .chat-page .hero h1{font-size:22px!important;line-height:1.05!important;margin:0!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;}
  .chat-page .hero p{display:none!important;}
  .chat-page .hero .badges{flex:0 0 auto!important;margin-left:auto!important;flex-wrap:nowrap!important;}
  .chat-page #onlineCount{min-width:0!important;font-size:12px!important;min-height:32px!important;padding:5px 9px!important;}
  .chat-page .chat-layout{display:block!important;width:100%!important;height:auto!important;flex:1 1 auto!important;min-height:0!important;overflow:hidden!important;}
  .chat-page .users-panel{display:none!important;}
  .chat-page .chatbox{width:100%!important;height:100%!important;min-height:0!important;border-radius:0!important;border-left:0!important;border-right:0!important;box-shadow:none!important;overflow:hidden!important;}
  .chat-page .chat-tools{flex:0 0 auto!important;height:42px!important;min-height:42px!important;padding:4px 10px!important;gap:4px!important;border-bottom:1px solid var(--line)!important;}
  .chat-page .chat-tools .chat-search{min-width:0!important;}
  .chat-page .chat-search input{height:34px!important;min-height:34px!important;padding:5px 10px!important;border-radius:10px!important;font-size:13px!important;}
  .chat-page #loadOlderBtn{flex:0 0 auto!important;margin:3px 8px!important;}
  .chat-page #messages{flex:1 1 auto!important;height:auto!important;min-height:0!important;max-height:none!important;overflow-y:auto!important;overflow-x:hidden!important;padding:7px 6px 10px!important;-webkit-overflow-scrolling:touch!important;}
  .chat-page #messages .message{margin:5px 0!important;}
  .chat-page .v27-composer{flex:0 0 auto!important;margin:0!important;padding:5px 8px calc(5px + env(safe-area-inset-bottom))!important;background:var(--card)!important;border-top:1px solid var(--line)!important;}
  .chat-page .v27-composer-row{min-height:48px!important;}
  .chat-page .online-panel{right:6px!important;top:calc(100% + 4px)!important;width:min(300px,calc(100vw - 16px))!important;max-height:300px!important;}
}

/* v126 — reactions/actions stay attached to the message bubble */
.chat-page .message .chat-bubble{overflow:visible!important}
.chat-page .message .msg-hover-tools{
  position:relative!important;
  left:auto!important;right:auto!important;top:auto!important;bottom:auto!important;
  width:fit-content!important;max-width:100%!important;
  margin:7px 0 0!important;
  padding:3px 5px!important;
  display:flex!important;align-items:center!important;flex-wrap:wrap!important;gap:4px!important;
  background:rgba(12,30,55,.92)!important;
  border:1px solid rgba(72,145,220,.22)!important;
  border-radius:13px!important;
  box-shadow:0 5px 16px rgba(0,0,0,.18)!important;
  transform:none!important;
  z-index:25!important;
}
.chat-page .message.me .msg-hover-tools{margin-left:auto!important}
.chat-page .message:not(.me) .msg-hover-tools{margin-right:auto!important}
.chat-page .message .msg-hover-tools .quick-reactions{
  position:relative!important;left:auto!important;right:auto!important;top:auto!important;bottom:auto!important;
  display:flex!important;align-items:center!important;flex-wrap:nowrap!important;gap:1px!important;
  padding:0!important;margin:0!important;
  background:transparent!important;border:0!important;box-shadow:none!important;
  opacity:1!important;visibility:visible!important;transform:none!important;
  white-space:nowrap!important;z-index:auto!important;
}
.chat-page .message .msg-hover-tools .quick-reactions .reaction{
  min-width:28px!important;width:28px!important;height:28px!important;
  padding:0!important;margin:0!important;border:0!important;background:transparent!important;
  border-radius:8px!important;font-size:17px!important;line-height:1!important;
  display:inline-flex!important;align-items:center!important;justify-content:center!important;
}
.chat-page .message .msg-hover-tools .quick-reactions .reaction:hover,
.chat-page .message .msg-hover-tools .quick-reactions .reaction.active{
  background:rgba(255,255,255,.10)!important;transform:scale(1.08)!important;
}
.chat-page .message .msg-hover-tools .tool-divider{display:none!important}
.chat-page .message .msg-hover-tools .reply-btn{
  min-width:30px!important;height:28px!important;min-height:28px!important;
  padding:3px 7px!important;margin:0!important;border:0!important;
  border-radius:8px!important;background:transparent!important;color:var(--text,#e8f1ff)!important;
  font-size:12px!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;
}
.chat-page .message .msg-hover-tools .reply-btn:hover{background:rgba(255,255,255,.10)!important}

/* Desktop: keep the action strip hidden until the message is hovered/focused. */
@media (min-width:901px){
 .chat-page .message .msg-hover-tools{opacity:0!important;visibility:hidden!important;pointer-events:none!important;transform:translateY(4px)!important}
 .chat-page .message:hover .msg-hover-tools,
 .chat-page .message:focus-within .msg-hover-tools,
 .chat-page .message.tools-open .msg-hover-tools{opacity:1!important;visibility:visible!important;pointer-events:auto!important;transform:none!important}
}

/* Mobile: tap the message to reveal the same compact strip directly underneath. */
@media (max-width:900px){
 .chat-page .message .msg-hover-tools,
 .chat-page .message.tools-open .msg-hover-tools{position:relative!important;left:auto!important;right:auto!important;top:auto!important;bottom:auto!important;max-width:100%!important;width:fit-content!important}
 .chat-page .message .msg-hover-tools{opacity:0!important;visibility:hidden!important;pointer-events:none!important;transform:translateY(3px)!important}
 .chat-page .message.tools-open .msg-hover-tools{opacity:1!important;visibility:visible!important;pointer-events:auto!important;transform:none!important}
 .chat-page .message .msg-hover-tools .quick-reactions{overflow:visible!important;max-width:100%!important}
}


/* v127 — reference reaction/action appearance only. Keep existing position and behavior. */
.chat-page #messages .message .msg-hover-tools{
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
  padding:0!important;
  border-radius:0!important;
}
.chat-page #messages .message .msg-hover-tools .quick-reactions{
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
}
.chat-page #messages .message .msg-hover-tools .quick-reactions .reaction{
  width:36px!important;
  min-width:36px!important;
  height:36px!important;
  min-height:36px!important;
  padding:0!important;
  margin:0 2px!important;
  border:1px solid rgba(72,145,220,.32)!important;
  border-radius:9px!important;
  background:rgba(12,30,55,.78)!important;
  box-shadow:0 2px 7px rgba(0,0,0,.16)!important;
  font-size:21px!important;
}
.chat-page #messages .message .msg-hover-tools .quick-reactions .reaction:hover,
.chat-page #messages .message .msg-hover-tools .quick-reactions .reaction.active{
  background:rgba(37,99,235,.22)!important;
  border-color:rgba(56,189,248,.62)!important;
  transform:scale(1.04)!important;
}
.chat-page #messages .message .msg-hover-tools .reply-btn{
  height:36px!important;
  min-height:36px!important;
  min-width:36px!important;
  padding:0 10px!important;
  margin:0 2px!important;
  border:1px solid rgba(72,145,220,.32)!important;
  border-radius:9px!important;
  background:rgba(12,30,55,.78)!important;
  box-shadow:0 2px 7px rgba(0,0,0,.16)!important;
  font-size:13px!important;
}
.chat-page #messages .message .msg-hover-tools .reply-btn:hover{
  background:rgba(37,99,235,.18)!important;
  border-color:rgba(56,189,248,.55)!important;
}
@media(max-width:900px){
 .chat-page #messages .message .msg-hover-tools .quick-reactions .reaction{
   width:34px!important;min-width:34px!important;height:34px!important;min-height:34px!important;font-size:20px!important;
 }
 .chat-page #messages .message .msg-hover-tools .reply-btn{
   height:34px!important;min-height:34px!important;
 }
}

/* v128 monetization UI */
.monet-vip-mark{display:inline-flex;align-items:center;padding:4px 8px;border-radius:999px;background:linear-gradient(135deg,#f59e0b,#facc15);color:#422006;font-size:11px;font-weight:900;vertical-align:middle}.paid-status-badge{margin-top:8px;align-items:center;width:max-content;max-width:100%;padding:7px 10px;border-radius:999px;font-weight:900;border:1px solid color-mix(in srgb,var(--status-color,#0ea5e9) 45%,transparent);background:color-mix(in srgb,var(--status-color,#0ea5e9) 10%,transparent);color:var(--status-color,#0ea5e9)}.paid-status-badge.status-style-sea{--status-color:#0ea5e9}.paid-status-badge.status-style-fire{--status-color:#ef4444}.paid-status-badge.status-style-diamond{--status-color:#8b5cf6}.paid-status-badge.status-style-gold{--status-color:#f59e0b}.vip-user .site-ad{display:none!important}

/* v129: site-wide mobile optimization + complete theme coverage.
   Deliberately excludes chat control/settings rules. */
html{overflow-x:hidden}
body{max-width:100%;overflow-x:hidden;box-sizing:border-box}
img,video,iframe,canvas,svg{max-width:100%;height:auto}
button,input,select,textarea{max-width:100%;box-sizing:border-box}

/* Make the selected site theme cover common containers used by every section. */
body.site-theme-ocean,body.site-theme-messenger,body.site-theme-dark,body.site-theme-glass,body.site-theme-modern{
  color:var(--text,#0f172a);
}
body.site-theme-ocean header,body.site-theme-messenger header,body.site-theme-modern header,
body.site-theme-glass header,body.site-theme-dark header{color:inherit}
body.site-theme-ocean .card,body.site-theme-ocean .panel,body.site-theme-ocean .box,body.site-theme-ocean .section,
body.site-theme-messenger .card,body.site-theme-messenger .panel,body.site-theme-messenger .box,body.site-theme-messenger .section,
body.site-theme-modern .card,body.site-theme-modern .panel,body.site-theme-modern .box,body.site-theme-modern .section,
body.site-theme-glass .card,body.site-theme-glass .panel,body.site-theme-glass .box,body.site-theme-glass .section,
body.site-theme-dark .card,body.site-theme-dark .panel,body.site-theme-dark .box,body.site-theme-dark .section{
  border-radius:var(--theme-r,18px);
}
body.site-theme-dark{color:#e5edf8}
body.site-theme-dark header,
body.site-theme-dark .card,body.site-theme-dark .panel,body.site-theme-dark .box,body.site-theme-dark .section,
body.site-theme-dark main,.site-theme-dark .page-head,.site-theme-dark .hero{color:#e5edf8}
body.site-theme-dark .card,body.site-theme-dark .panel,body.site-theme-dark .box,body.site-theme-dark .section,
body.site-theme-dark .topic-row,body.site-theme-dark .active-row,body.site-theme-dark .friend-row,
body.site-theme-dark .notification-item,body.site-theme-dark .conversation-row{background:#0f172a;border-color:#26344b;color:#e5edf8}
body.site-theme-dark .mobile-nav{background:rgba(7,13,24,.96);border-color:#26344b}
body.site-theme-dark a,body.site-theme-dark .topnav a{color:#dbeafe}
body.site-theme-dark input,body.site-theme-dark textarea,body.site-theme-dark select{background:#0b1322;color:#e5edf8;border-color:#26344b}
body.site-theme-glass .card,body.site-theme-glass .panel,body.site-theme-glass .box,body.site-theme-glass .section,
body.site-theme-glass .topic-row,body.site-theme-glass .active-row,body.site-theme-glass .friend-row,
body.site-theme-glass .notification-item,body.site-theme-glass .conversation-row{
  background:rgba(255,255,255,.54);border-color:rgba(255,255,255,.62);backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px)
}
body.site-theme-glass .mobile-nav{background:rgba(255,255,255,.72);backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px)}
body.site-theme-messenger .card,body.site-theme-messenger .panel,body.site-theme-messenger .box,body.site-theme-messenger .section{box-shadow:0 5px 18px rgba(15,23,42,.07)}
body.site-theme-ocean .card,body.site-theme-ocean .panel,body.site-theme-ocean .box,body.site-theme-ocean .section{box-shadow:0 7px 24px rgba(2,132,199,.08)}

/* Global mobile layout: no horizontal overflow, cramped grids, or wrapped navigation. */
@media (max-width:700px){
  body:not(.chat-page){padding-bottom:68px;min-width:0}
  body:not(.chat-page) header{padding:8px 10px;gap:8px;min-width:0;overflow:hidden}
  body:not(.chat-page) header .brand{min-width:0;max-width:46vw;flex:0 1 auto;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:15px;letter-spacing:-.02em}
  body:not(.chat-page) header .brand b{display:inline-block;max-width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
  body:not(.chat-page) header .topnav{min-width:0;flex:1 1 auto;display:flex;flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;justify-content:flex-start;gap:3px}
  body:not(.chat-page) header .topnav::-webkit-scrollbar{display:none}
  body:not(.chat-page) header .topnav a,body:not(.chat-page) header .topnav button{flex:0 0 auto;white-space:nowrap;font-size:12px;padding:7px 8px}
  body:not(.chat-page) main{width:100%;max-width:none;box-sizing:border-box;padding:10px 8px 24px}
  body:not(.chat-page) .hero,body:not(.chat-page) .page-head{gap:10px;padding:10px 2px 14px;align-items:stretch}
  body:not(.chat-page) .hero h1,body:not(.chat-page) .page-head h1{font-size:clamp(24px,8vw,34px);overflow-wrap:anywhere}
  body:not(.chat-page) .hero p,body:not(.chat-page) .page-head p{overflow-wrap:anywhere}
  body:not(.chat-page) .card,body:not(.chat-page) .panel,body:not(.chat-page) .box,body:not(.chat-page) .section{min-width:0;max-width:100%;box-sizing:border-box}
  body:not(.chat-page) .grid,body:not(.chat-page) .market-detail,body:not(.chat-page) .market-form-grid{grid-template-columns:1fr!important}
  body:not(.chat-page) .wide{grid-column:auto!important}
  body:not(.chat-page) .market-form-grid{gap:8px}
  body:not(.chat-page) .market-detail .gallery-main{height:min(72vw,360px)}
  body:not(.chat-page) .market-actions,body:not(.chat-page) .notification-actions{width:100%;gap:7px}
  body:not(.chat-page) .market-actions>* ,body:not(.chat-page) .notification-actions>*{min-width:0;max-width:100%}
  body:not(.chat-page) table{display:block;width:100%;overflow-x:auto}
  body:not(.chat-page) .mobile-nav{display:flex}
  body:not(.chat-page) .topnav a{max-width:none}
  body:not(.chat-page) .people-profile-btn{max-width:100%;white-space:nowrap}
  body:not(.chat-page) .friend-row{min-width:0;overflow:hidden;gap:7px}
  body:not(.chat-page) .friend-row>div{min-width:0;overflow:hidden}
  body:not(.chat-page) .friend-row b,body:not(.chat-page) .friend-row small{display:block;overflow-wrap:anywhere;word-break:break-word}
  body:not(.chat-page) .friend-row a,body:not(.chat-page) .friend-row button{font-size:11px;padding:7px;white-space:nowrap}
  body:not(.chat-page) .notification-item{min-width:0;overflow:hidden}
  body:not(.chat-page) .notification-item p,body:not(.chat-page) .notification-item b,body:not(.chat-page) .notification-item small{overflow-wrap:anywhere;word-break:break-word}
  body:not(.chat-page) .notification-actions a,body:not(.chat-page) .notification-actions button{flex:1 1 120px}
  body:not(.chat-page) .active-row{min-width:0;grid-template-columns:auto 40px minmax(0,1fr)!important}
  body:not(.chat-page) .active-stats{grid-column:3;text-align:left}
  body:not(.chat-page) .profile-nav{overflow-x:auto;display:flex;flex-wrap:nowrap;scrollbar-width:none}
  body:not(.chat-page) .profile-nav::-webkit-scrollbar{display:none}
  body:not(.chat-page) .profile-nav a{flex:0 0 auto;white-space:nowrap}
  body:not(.chat-page) .modal,.modal-content,.popup,.dropdown{max-width:calc(100vw - 16px);box-sizing:border-box}
}

/* Profile/friends are legacy chat-page shells but get layout protection without touching chat controls. */
@media(max-width:700px){
  body.profile-modern main{height:auto!important;min-height:0!important;padding:8px!important}
  body.profile-modern .profile-card,body.profile-modern .profile-panel,body.profile-modern .profile-main-col{min-width:0;max-width:100%;box-sizing:border-box}
  body.profile-modern .profile-title h1,body.profile-modern .profile-title p{overflow-wrap:anywhere;word-break:break-word}
  body.profile-modern .profile-head-actions{min-width:0}
  body.profile-modern .profile-head-actions>*{max-width:100%;min-width:0}
  body.chat-page.friends-page{padding-bottom:68px}
  body.chat-page.friends-page main{height:auto!important;min-height:0!important;width:100%!important;padding:8px!important}
  body.chat-page.friends-page .card{min-width:0;max-width:100%;box-sizing:border-box}
}

/* Story viewer: fit the phone viewport without changing story behavior. */
@media(max-width:700px){
  body.story-page{min-height:100dvh;overflow-x:hidden}
  body.story-page #storyApp{width:100%;max-width:100vw;min-height:100dvh;box-sizing:border-box}
  body.story-page .story-top{padding:10px 12px;gap:8px;box-sizing:border-box}
  body.story-page .story-view{width:100%;max-width:100vw;box-sizing:border-box;overflow:hidden}
}
/* v129 early theme paint: prevents a white flash before template.js applies the body class. */
html[data-site-theme="ocean"] body{background-color:#eef8ff}
html[data-site-theme="messenger"] body{background-color:#f4f7fb}
html[data-site-theme="dark"] body{background-color:#070d18;color:#e5edf8}
html[data-site-theme="glass"] body{background-color:#dfeffc}
html[data-site-theme="modern"] body{background-color:#f7f8fa}

/* ===== v131 — mobile chat visual/geometry fixes from device screenshot ===== */
@media (max-width:700px){
  /* Keep the chat header and online counter on one row; never overlap search. */
  .chat-page .hero{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    align-items:center!important;
    min-height:58px!important;
    height:auto!important;
    padding:7px 10px!important;
    margin:0!important;
    gap:8px!important;
    position:relative!important;
    z-index:20!important;
  }
  .chat-page .hero > div:first-child{min-width:0!important;width:auto!important;}
  .chat-page .hero h1{
    font-size:22px!important;
    line-height:1.05!important;
    margin:0!important;
    text-align:left!important;
  }
  .chat-page .hero .badges{
    width:auto!important;
    min-width:0!important;
    margin:0!important;
    display:flex!important;
    align-items:center!important;
    justify-content:flex-end!important;
    flex-wrap:nowrap!important;
  }
  .chat-page .online-widget{position:relative!important;z-index:21!important;}
  .chat-page #onlineCount{
    height:34px!important;
    min-height:34px!important;
    padding:5px 9px!important;
    white-space:nowrap!important;
  }

  /* Search gets its own row and can never cover the message list. */
  .chat-page .chat-tools{
    position:relative!important;
    z-index:10!important;
    height:44px!important;
    min-height:44px!important;
    padding:5px 9px!important;
    margin:0!important;
    background:var(--card,#0f172a)!important;
    border-bottom:1px solid var(--line)!important;
  }
  .chat-page .chat-search{width:100%!important;min-width:0!important;flex:1 1 auto!important;}
  .chat-page .chat-search input{
    width:100%!important;
    height:34px!important;
    min-height:34px!important;
    margin:0!important;
    padding:5px 10px!important;
    box-sizing:border-box!important;
  }

  /* Messages must size to their content, not stretch into large empty blue cards. */
  .chat-page #messages .message{
    height:auto!important;
    min-height:0!important;
    align-items:flex-end!important;
    flex:none!important;
  }
  .chat-page #messages .chat-bubble{
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    align-self:flex-end!important;
    flex:0 0 auto!important;
  }
  .chat-page #messages .message:not(.me) .chat-bubble{align-self:flex-start!important;}
  .chat-page #messages .chat-bubble:empty{display:none!important;}

  /* Do not let reaction/action controls make the bubble itself look like a huge block. */
  .chat-page #messages .msg-hover-tools{max-height:42px!important;overflow-x:auto!important;overflow-y:hidden!important;}
  .chat-page #messages .msg-hover-tools .quick-reactions{flex:0 0 auto!important;}

  /* Five composer controls: text + microphone + emoji + attachment + send, all on one row. */
  .chat-page .v27-composer{
    position:fixed!important;
    left:7px!important;
    right:7px!important;
    bottom:68px!important;
    width:auto!important;
    margin:0!important;
    padding:5px!important;
    z-index:1200!important;
    background:transparent!important;
    border:0!important;
  }
  .chat-page .v27-composer-row{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) repeat(4,38px)!important;
    gap:4px!important;
    width:100%!important;
    min-height:48px!important;
    padding:4px!important;
    box-sizing:border-box!important;
    background:var(--card,#0f172a)!important;
    border:1px solid var(--line)!important;
    border-radius:16px!important;
  }
  .chat-page .v27-composer #text{
    grid-column:auto!important;
    width:100%!important;
    min-width:0!important;
    min-height:38px!important;
    max-height:76px!important;
    padding:8px 7px!important;
    font-size:14px!important;
    line-height:1.25!important;
  }
  .chat-page .v27-composer-row .chat-tool-btn,
  .chat-page .v27-composer-row .v27-emoji-btn,
  .chat-page .v27-composer-row .v27-send{
    width:38px!important;
    min-width:38px!important;
    max-width:38px!important;
    height:38px!important;
    min-height:38px!important;
    padding:0!important;
    margin:0!important;
    border-radius:11px!important;
    box-sizing:border-box!important;
  }
  .chat-page .v27-composer-row .chat-tool-btn{
    display:grid!important;
    place-items:center!important;
    background:#172230!important;
    color:#e5edf8!important;
    border:1px solid #26384d!important;
    font-size:17px!important;
  }
  .chat-page .v27-composer-row .v27-emoji-btn{background:#202b38!important;color:#fff!important;}
  .chat-page .v27-composer-row .v27-send{background:#d90429!important;color:#fff!important;}

  /* The message list reserves room for the fixed composer and bottom navigation. */
  .chat-page #messages{padding-bottom:92px!important;}

  /* Dark themes must keep the bottom navigation dark instead of reverting to white. */
  body.dark.chat-page .mobile-nav,
  body.site-theme-dark .mobile-nav{
    background:rgba(7,13,24,.97)!important;
    border-top-color:#26344b!important;
    color:#dbeafe!important;
  }
  body.dark.chat-page .mobile-nav a,
  body.site-theme-dark .mobile-nav a{color:#94a3b8!important;}
  body.dark.chat-page .mobile-nav a.active,
  body.site-theme-dark .mobile-nav a.active{color:#38bdf8!important;}

  /* Online users: orange background belongs to the nickname itself, not the whole card. */
  .chat-page .online-panel .online-users>a b{
    display:inline-block!important;
    max-width:100%!important;
    padding:3px 7px!important;
    border-radius:7px!important;
    background:#f59e0b!important;
    color:#111827!important;
  }
}

/* ===== v132 — redesigned mobile bottom navigation ===== */
@media (max-width:700px){
  .mobile-nav{
    position:fixed!important;
    left:0!important;
    right:0!important;
    bottom:0!important;
    height:82px!important;
    min-height:82px!important;
    box-sizing:border-box!important;
    display:flex!important;
    align-items:stretch!important;
    justify-content:space-around!important;
    gap:0!important;
    padding:7px 4px calc(7px + env(safe-area-inset-bottom))!important;
    background:rgba(5,13,27,.97)!important;
    border-top:1px solid rgba(65,104,150,.42)!important;
    box-shadow:0 -8px 30px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.025)!important;
    backdrop-filter:blur(18px)!important;
    -webkit-backdrop-filter:blur(18px)!important;
    z-index:130!important;
  }
  .mobile-nav a{
    position:relative!important;
    flex:1 1 0!important;
    min-width:0!important;
    max-width:none!important;
    height:68px!important;
    padding:5px 2px 4px!important;
    margin:0!important;
    display:flex!important;
    flex-direction:column!important;
    align-items:center!important;
    justify-content:center!important;
    gap:3px!important;
    box-sizing:border-box!important;
    border-radius:14px!important;
    color:#8ea3c0!important;
    text-decoration:none!important;
    font-size:28px!important;
    line-height:1!important;
    white-space:nowrap!important;
    overflow:visible!important;
    transition:background .16s ease, color .16s ease, transform .16s ease, filter .16s ease!important;
  }
  .mobile-nav a span{
    display:block!important;
    max-width:100%!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    font-size:11px!important;
    line-height:1.15!important;
    font-weight:800!important;
    letter-spacing:.01em!important;
    color:inherit!important;
  }
  .mobile-nav a:hover{transform:none!important;background:rgba(56,189,248,.06)!important;}
  .mobile-nav a.active{
    color:#35bdf5!important;
    background:linear-gradient(180deg,rgba(18,67,108,.26),rgba(18,67,108,.06))!important;
    text-shadow:0 0 12px rgba(56,189,248,.42)!important;
  }
  .mobile-nav a.active::after{
    content:"";
    position:absolute!important;
    left:18%!important;
    right:18%!important;
    bottom:1px!important;
    height:4px!important;
    border-radius:999px!important;
    background:#2eb9f4!important;
    box-shadow:0 0 12px rgba(46,185,244,.75)!important;
  }
  .mobile-nav a[href="chat.php"]{color:#7fa0bf!important;}
  .mobile-nav a[href="chat.php"].active{color:#38bdf8!important;}
  .mobile-nav a[href="market.php"]{color:#8da7c4!important;}
  .mobile-nav a[href="forum.php"]{color:#8da7c4!important;}
  .mobile-nav a[href="notifications.php"]{color:#8da7c4!important;}
  .mobile-nav a[href="profile.php"]{color:#8da7c4!important;}
  .mobile-nav .global-notify-badge,
  .mobile-nav .forum-new-badge,
  .mobile-nav .ann-new-badge,
  .mobile-nav .market-new-badge{
    top:2px!important;
    right:calc(50% - 24px)!important;
    min-width:18px!important;
    height:18px!important;
    padding:0 5px!important;
    border-radius:999px!important;
    font-size:10px!important;
    line-height:18px!important;
    box-sizing:border-box!important;
    z-index:4!important;
  }
  body.chat-page .mobile-nav{bottom:0!important;}
  body.chat-page{padding-bottom:86px!important;}

  /* Keep the five destinations visually identical across pages. */
  body.site-theme-dark .mobile-nav,
  body.dark .mobile-nav,
  body.chat-page .mobile-nav{
    background:rgba(5,13,27,.97)!important;
    border-top-color:rgba(65,104,150,.42)!important;
  }
  body.site-theme-glass .mobile-nav{
    background:rgba(5,13,27,.86)!important;
  }
}


/* ===== v133 — final mobile containment audit ===== */
@media (max-width:700px){
  html,body{width:100%;max-width:100%;overflow-x:hidden!important;}
  body{min-width:0!important;}
  img,video,iframe,svg,canvas{max-width:100%;}
  input,select,textarea,button{max-width:100%;box-sizing:border-box;}
  pre,code{max-width:100%;white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;}
  header,main,footer,section,article,aside,nav,form,fieldset,table,.card,.panel,.box,.section,
  .page-head,.hero,.grid,.list,.topic-list,.friend-row,.notification-item,.market-detail,
  .market-form-grid,.admin-pro-tabs,.pro-form,.seller-box,.info-row{
    min-width:0!important;max-width:100%!important;box-sizing:border-box!important;
  }
  .page-head h1,.page-head p,.hero h1,.hero p,h1,h2,h3,h4,h5,h6,p,small,b,strong,a,span,label,li,td,th{
    overflow-wrap:anywhere;word-break:break-word;
  }
  .topnav,.profile-nav{max-width:100%;}
  .topnav a,.profile-nav a{flex:0 0 auto;max-width:100%;}
  table{display:block;overflow-x:auto;}
  .modal,.modal-content,.popup,.dropdown,.menu,.dialog{max-width:calc(100vw - 16px)!important;}
}

/* v134: forum dark theme coverage only */
body.site-theme-dark .forum-page .forum-category,
body.site-theme-dark .forum-page .topic-row{
  background:#0f172a!important;
  color:#e5edf8!important;
  border-color:#26344b!important;
}
body.site-theme-dark .forum-page .forum-category:hover,
body.site-theme-dark .forum-page .topic-row:hover{
  background:#111c2e!important;
  border-color:#3b82f6!important;
}
body.site-theme-dark .forum-page .forum-icon,
body.site-theme-dark .forum-page .topic-icon{
  background:#17233a!important;
  color:#e5edf8!important;
}
body.site-theme-dark .forum-page .topic-main small,
body.site-theme-dark .forum-page .topic-last,
body.site-theme-dark .forum-page .forum-category em{
  color:#94a3b8!important;
}
body.site-theme-dark .forum-page .forum-back button{
  background:#111c2e!important;
  color:#dbeafe!important;
  border-color:#26344b!important;
}

/* v136: forum dark-theme compatibility — forum only */
html[data-theme="dark"] body .forum-page,
html[data-theme="dark"] body .forum-page .page-head,
html[data-theme="dark"] body .forum-page .forum-card,
html[data-theme="dark"] body .forum-page .topic-list,
html[data-theme="dark"] body .forum-page .forum-category,
html[data-theme="dark"] body .forum-page .topic-row,
html[data-theme="dark"] body .forum-page .forum-back,
html[data-theme="dark"] body .forum-page .new-topic{
  color:#e5edf8!important;
}
html[data-theme="dark"] body .forum-page .forum-category,
html[data-theme="dark"] body .forum-page .topic-row,
html[data-theme="dark"] body .forum-page .forum-card,
html[data-theme="dark"] body .forum-page .topic-list,
html[data-theme="dark"] body .forum-page .new-topic{
  background:#0f172a!important;
  border-color:#26344b!important;
}
html[data-theme="dark"] body .forum-page .forum-icon,
html[data-theme="dark"] body .forum-page .topic-icon{
  background:#17233a!important;
  color:#e5edf8!important;
}
html[data-theme="dark"] body .forum-page .topic-main small,
html[data-theme="dark"] body .forum-page .topic-last,
html[data-theme="dark"] body .forum-page .forum-category em,
html[data-theme="dark"] body .forum-page .page-head p{
  color:#94a3b8!important;
}
html[data-theme="dark"] body .forum-page input,
html[data-theme="dark"] body .forum-page textarea,
html[data-theme="dark"] body .forum-page select{
  background:#0b1322!important;
  color:#e5edf8!important;
  border-color:#26344b!important;
}
html[data-theme="dark"] body .forum-page .forum-back button,
html[data-theme="dark"] body .forum-page .secondary{
  background:#111c2e!important;
  color:#dbeafe!important;
  border-color:#26344b!important;
}
html[data-theme="dark"] body .forum-page .primary{
  color:#fff!important;
}
html[data-theme="dark"] body .forum-page .forum-category:hover,
html[data-theme="dark"] body .forum-page .topic-row:hover{
  background:#111c2e!important;
  border-color:#3b82f6!important;
}

/* v139: точечное исправление вида раздела объявлений. Только CSS. */
.market-page{overflow-x:hidden}
.market-page .market-category-chips{
  display:flex!important;
  flex-wrap:wrap!important;
  gap:8px!important;
  overflow:visible!important;
  padding:2px 0 10px!important;
  scrollbar-width:none!important;
}
.market-page .market-category-chips::-webkit-scrollbar{display:none!important;height:0!important}
.market-page .market-category-chip{flex:0 0 auto!important;max-width:100%;box-sizing:border-box}

/* Не оставлять светлые элементы в тёмной теме. */
html[data-site-theme="dark"] body.market-page .market-photo,
body.site-theme-dark.market-page .market-photo,
html.dark-preload body.market-page .market-photo{
  background:linear-gradient(135deg,#111c2e,#0b1322)!important;
  color:#8fa5c2!important;
}
html[data-site-theme="dark"] body.market-page .market-tools button,
body.site-theme-dark.market-page .market-tools button,
html.dark-preload body.market-page .market-tools button{
  background:#17233a!important;
  color:#e5edf8!important;
  border-color:#26344b!important;
}
html[data-site-theme="dark"] body.market-page .market-tools button:hover,
body.site-theme-dark.market-page .market-tools button:hover,
html.dark-preload body.market-page .market-tools button:hover{
  background:#20304a!important;
}
html[data-site-theme="dark"] body.market-page .market-tools .secondary,
body.site-theme-dark.market-page .market-tools .secondary,
html.dark-preload body.market-page .market-tools .secondary{
  background:#111c2e!important;
  color:#cbd5e1!important;
}
html[data-site-theme="dark"] body.market-page .fav,
body.site-theme-dark.market-page .fav,
html.dark-preload body.market-page .fav{
  background:rgba(15,23,42,.92)!important;
  color:#fff!important;
}

/* На узком экране категории не должны создавать горизонтальный скролл. */
@media(max-width:700px){
  .market-page .market-category-chips{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    overflow:visible!important;
  }
  .market-page .market-category-chip{width:100%!important;min-width:0!important;}
}

/* v145: global Instagram-like story tray under the top site header. */
.global-story-tray{position:relative;z-index:20;width:100%;box-sizing:border-box;background:rgba(5,15,22,.92);border-bottom:1px solid rgba(255,255,255,.10);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);overflow:hidden}
.global-story-tray-inner{display:flex;align-items:flex-start;gap:14px;overflow-x:auto;overflow-y:hidden;padding:9px 14px 8px;scrollbar-width:none;-webkit-overflow-scrolling:touch;min-height:82px;box-sizing:border-box}
.global-story-tray-inner::-webkit-scrollbar{display:none}
.global-story-user{flex:0 0 68px;width:68px;min-width:68px;text-align:center;text-decoration:none;color:inherit;font-size:11px;line-height:1.2;display:block}
.global-story-user b{display:block;margin-top:5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:700}
.global-story-avatar{width:58px;height:58px;margin:0 auto;border-radius:50%;padding:3px;box-sizing:border-box;background:linear-gradient(135deg,#ff7a18,#e1306c,#833ab4);box-shadow:0 0 0 3px rgba(255,70,120,.14),0 0 18px rgba(225,48,108,.42);animation:globalStoryPulse 1.8s ease-in-out infinite}
.global-story-avatar>span,.global-story-avatar img{display:grid;width:100%;height:100%;place-items:center;border-radius:50%;overflow:hidden;object-fit:cover;background:#17242d;border:3px solid #fff;box-sizing:border-box;font-size:22px}
.global-story-avatar.viewed{background:#68747b;box-shadow:none;animation:none}
.global-story-add .global-story-avatar{background:linear-gradient(135deg,#2563eb,#7c3aed)}
.global-story-add .global-story-avatar span{font-size:29px;color:#fff}
@keyframes globalStoryPulse{50%{transform:scale(1.035);box-shadow:0 0 0 4px rgba(255,70,120,.18),0 0 24px rgba(225,48,108,.62)}}
.global-story-tray-loading{padding:18px 4px;font-size:12px;opacity:.72;white-space:nowrap}
@media(max-width:700px){.global-story-tray-inner{gap:11px;padding:8px 10px 7px;min-height:78px}.global-story-user{flex-basis:60px;width:60px;min-width:60px;font-size:10.5px}.global-story-avatar{width:52px;height:52px}.global-story-avatar>span,.global-story-avatar img{width:40px;height:40px}.global-story-avatar{padding:6px}.global-story-user b{margin-top:4px}}

/* v145: only align the admin crown with the login baseline; no other crown styling changes. */
.profile-name-row h1 .admin-badge{align-self:baseline!important;transform:none!important;vertical-align:baseline!important;}

/* v146: online list names must stay readable on light panels. */
.online-panel .online-users>a span:not(.online-mini-avatar),
.online-panel .online-users>a b,
.online-panel .online-users>a small{color:#f59e0b!important;text-shadow:none!important;}

/* v147: only change the white nickname pill in the online list to orange. */
.online-panel .online-users>a b{
  display:inline-block!important;
  padding:4px 9px!important;
  border-radius:999px!important;
  background:#f59e0b!important;
  color:#fff!important;
  font-weight:900!important;
}
.online-panel .online-users>a span:not(.online-mini-avatar){color:#172033!important;}
.online-panel .online-users>a small{color:#475569!important;}
body.dark .online-panel .online-users>a span:not(.online-mini-avatar),
html[data-theme="dark"] .online-panel .online-users>a span:not(.online-mini-avatar){color:#f8fafc!important;}
body.dark .online-panel .online-users>a b,
html[data-theme="dark"] .online-panel .online-users>a b{color:#fff!important;}
body.dark .online-panel .online-users>a small,
html[data-theme="dark"] .online-panel .online-users>a small{color:#cbd5e1!important;}

/* v153: mobile forum dark-theme fix — forum only */
@media (max-width: 640px){
  body.site-theme-dark .forum-page,
  body.dark .forum-page,
  html[data-theme="dark"] body .forum-page{
    background:transparent!important;
    color:#e5edf8!important;
  }
  body.site-theme-dark .forum-page .page-head,
  body.site-theme-dark .forum-page .forum-card,
  body.site-theme-dark .forum-page .topic-list,
  body.site-theme-dark .forum-page .forum-category,
  body.site-theme-dark .forum-page .topic-row,
  body.site-theme-dark .forum-page .forum-back,
  body.site-theme-dark .forum-page .new-topic,
  body.dark .forum-page .page-head,
  body.dark .forum-page .forum-card,
  body.dark .forum-page .topic-list,
  body.dark .forum-page .forum-category,
  body.dark .forum-page .topic-row,
  body.dark .forum-page .forum-back,
  body.dark .forum-page .new-topic,
  html[data-theme="dark"] body .forum-page .page-head,
  html[data-theme="dark"] body .forum-page .forum-card,
  html[data-theme="dark"] body .forum-page .topic-list,
  html[data-theme="dark"] body .forum-page .forum-category,
  html[data-theme="dark"] body .forum-page .topic-row,
  html[data-theme="dark"] body .forum-page .forum-back,
  html[data-theme="dark"] body .forum-page .new-topic{
    background:#0f172a!important;
    color:#e5edf8!important;
    border-color:#26344b!important;
  }
  body.site-theme-dark .forum-page .forum-icon,
  body.site-theme-dark .forum-page .topic-icon,
  body.dark .forum-page .forum-icon,
  body.dark .forum-page .topic-icon,
  html[data-theme="dark"] body .forum-page .forum-icon,
  html[data-theme="dark"] body .forum-page .topic-icon{
    background:#17233a!important;
    color:#e5edf8!important;
  }
  body.site-theme-dark .forum-page .topic-main small,
  body.site-theme-dark .forum-page .topic-last,
  body.site-theme-dark .forum-page .forum-category em,
  body.site-theme-dark .forum-page .page-head p,
  body.dark .forum-page .topic-main small,
  body.dark .forum-page .topic-last,
  body.dark .forum-page .forum-category em,
  body.dark .forum-page .page-head p,
  html[data-theme="dark"] body .forum-page .topic-main small,
  html[data-theme="dark"] body .forum-page .topic-last,
  html[data-theme="dark"] body .forum-page .forum-category em,
  html[data-theme="dark"] body .forum-page .page-head p{
    color:#94a3b8!important;
  }
  body.site-theme-dark .forum-page input,
  body.site-theme-dark .forum-page textarea,
  body.site-theme-dark .forum-page select,
  body.dark .forum-page input,
  body.dark .forum-page textarea,
  body.dark .forum-page select,
  html[data-theme="dark"] body .forum-page input,
  html[data-theme="dark"] body .forum-page textarea,
  html[data-theme="dark"] body .forum-page select{
    background:#0b1322!important;
    color:#e5edf8!important;
    border-color:#26344b!important;
  }
}

/* v154: chat header cleanup — no story tray above chat; stories live in the top navigation. */
.chat-page .global-story-tray,
.chat-page #chatStoryTray{display:none!important;}
.chat-page header .topnav{gap:3px!important;}
.chat-page header .topnav a[href="notifications.php"]{
  flex:0 0 34px!important;
  width:34px!important;
  min-width:34px!important;
  padding-left:4px!important;
  padding-right:4px!important;
  text-align:center!important;
}
.chat-page header .topnav .chat-stories-link{white-space:nowrap!important;}
.chat-page header .topnav .chat-logout-link{
  white-space:nowrap!important;
  margin-left:auto!important;
}
.chat-page .chat-userline .admin-badge,
.chat-page .msg-head .admin-badge,
.chat-page .profile-mini b .admin-badge{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  vertical-align:baseline!important;
  position:static!important;
  top:auto!important;
  transform:none!important;
  line-height:1!important;
  height:1em!important;
  margin:0 3px 0 0!important;
}
@media(max-width:700px){
  .chat-page header .topnav{gap:2px!important;}
  .chat-page header .topnav a[href="notifications.php"]{
    flex:0 0 32px!important;
    width:32px!important;
    min-width:32px!important;
    padding-left:2px!important;
    padding-right:2px!important;
  }
  .chat-page header .topnav .chat-logout-link{margin-left:4px!important;}
}

/* v156 — mobile chat: one page scrollbar only; profile link remains tappable. */
@media(max-width:700px){
  html:has(body.chat-page:not(.profile-modern)){
    overflow:hidden!important;
    height:100%;
  }
  body.chat-page:not(.profile-modern){
    height:100dvh!important;
    min-height:100dvh!important;
    overflow:hidden!important;
    padding-bottom:0!important;
  }
  body.chat-page:not(.profile-modern) main{
    height:calc(100dvh - 54px - 76px)!important;
    min-height:0!important;
    overflow:hidden!important;
  }
  body.chat-page:not(.profile-modern) .chat-layout{
    height:100%!important;
    min-height:0!important;
    overflow:hidden!important;
  }
  body.chat-page:not(.profile-modern) .chatbox{
    height:100%!important;
    min-height:0!important;
    overflow:hidden!important;
  }
  body.chat-page:not(.profile-modern) #messages{
    min-height:0!important;
    max-height:none!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    -webkit-overflow-scrolling:touch;
  }
  body.chat-page .mobile-nav a[href^="profile.php"]{
    position:relative!important;
    z-index:500!important;
    pointer-events:auto!important;
    touch-action:manipulation!important;
  }
}


/* v158: unified dark-theme coverage for every site section.
   Uses the current site-theme setting and also supports the legacy body.dark flag. */
html[data-site-theme="dark"],
html[data-site-theme="dark"] body,
body.site-theme-dark,
body.dark{
  background-color:#070d18!important;
  color:#e5edf8!important;
}
html[data-site-theme="dark"] body,
body.site-theme-dark,
body.dark{--bg:#070d18;--card:#0f172a;--card2:#111c2e;--text:#e5edf8;--muted:#94a3b8;--line:#26344b;}

/* Common containers across home, forum, announcements, marketplace, people, profile,
   notifications, activity, rules, social, stories, monetization and admin. */
body.site-theme-dark main,
body.dark main{color:#e5edf8!important;}
body.site-theme-dark .card,
body.site-theme-dark .panel,
body.site-theme-dark .box,
body.site-theme-dark .section,
body.site-theme-dark .forum-card,
body.site-theme-dark .topic-list,
body.site-theme-dark .rules-card,
body.site-theme-dark .admin-card,
body.site-theme-dark .profile-card,
body.site-theme-dark .notification-item,
body.site-theme-dark .news-card,
body.site-theme-dark .market-tools,
body.site-theme-dark .market-form,
body.site-theme-dark .market-detail,
body.site-theme-dark .market-comments,
body.site-theme-dark .seller-box,
body.site-theme-dark .active-row,
body.site-theme-dark .friend-row,
body.site-theme-dark .v27-person,
body.site-theme-dark .social-card,
body.site-theme-dark .monet-card,
body.site-theme-dark .monet-status,
body.site-theme-dark .v23card,
body.site-theme-dark .g .card,
body.dark .card,
body.dark .panel,
body.dark .box,
body.dark .section,
body.dark .forum-card,
body.dark .topic-list,
body.dark .rules-card,
body.dark .admin-card,
body.dark .profile-card,
body.dark .notification-item,
body.dark .news-card,
body.dark .market-tools,
body.dark .market-form,
body.dark .market-detail,
body.dark .market-comments,
body.dark .seller-box,
body.dark .active-row,
body.dark .friend-row,
body.dark .v27-person,
body.dark .social-card,
body.dark .monet-card,
body.dark .monet-status,
body.dark .v23card,
body.dark .g .card{
  background:#0f172a!important;
  color:#e5edf8!important;
  border-color:#26344b!important;
}

body.site-theme-dark .page-head,
body.site-theme-dark .hero,
body.site-theme-dark .hero73,
body.site-theme-dark .social-hero,
body.site-theme-dark .market-hero,
body.site-theme-dark .monet-wrap,
body.dark .page-head,
body.dark .hero,
body.dark .hero73,
body.dark .social-hero,
body.dark .market-hero,
body.dark .monet-wrap{color:#e5edf8!important;}

body.site-theme-dark .home73card,
body.site-theme-dark .stat73,
body.site-theme-dark .service73,
body.site-theme-dark .alert73,
body.site-theme-dark .item73,
body.site-theme-dark .story-top-tray,
body.site-theme-dark .story-top-user,
body.dark .home73card,
body.dark .stat73,
body.dark .service73,
body.dark .alert73,
body.dark .item73,
body.dark .story-top-tray,
body.dark .story-top-user{
  color:#e5edf8!important;
}
body.site-theme-dark .home73card,
body.site-theme-dark .stat73,
body.site-theme-dark .service73,
body.site-theme-dark .alert73,
body.dark .home73card,
body.dark .stat73,
body.dark .service73,
body.dark .alert73{
  background:#0f172a!important;border-color:#26344b!important;
}
body.site-theme-dark .service73 a,
body.site-theme-dark .chips73 a,
body.site-theme-dark .home73card a,
body.dark .service73 a,
body.dark .chips73 a,
body.dark .home73card a{color:#dbeafe!important;}

/* Text, links and muted labels. */
body.site-theme-dark a, body.dark a{color:#93c5fd;}
body.site-theme-dark .muted,
body.site-theme-dark small,
body.site-theme-dark .topic-main small,
body.site-theme-dark .topic-last,
body.site-theme-dark .news-card small,
body.site-theme-dark .market-hint,
body.site-theme-dark .eyebrow,
body.dark .muted,
body.dark small,
body.dark .topic-main small,
body.dark .topic-last,
body.dark .news-card small,
body.dark .market-hint{color:#94a3b8!important;}
body.site-theme-dark h1,body.site-theme-dark h2,body.site-theme-dark h3,body.site-theme-dark h4,
body.dark h1,body.dark h2,body.dark h3,body.dark h4{color:#f1f5f9;}

/* Form controls and buttons. */
body.site-theme-dark input,
body.site-theme-dark textarea,
body.site-theme-dark select,
body.site-theme-dark .secondary,
body.dark input,
body.dark textarea,
body.dark select,
body.dark .secondary{
  background:#0b1322!important;color:#e5edf8!important;border-color:#334155!important;
}
body.site-theme-dark input::placeholder,body.site-theme-dark textarea::placeholder,
body.dark input::placeholder,body.dark textarea::placeholder{color:#64748b!important;}
body.site-theme-dark button:not(.primary),body.dark button:not(.primary){color:#e5edf8;}
body.site-theme-dark .primary,body.dark .primary{color:#fff!important;}

/* Forum + thread. */
body.site-theme-dark .forum-page .forum-category,
body.site-theme-dark .forum-page .topic-row,
body.site-theme-dark .thread-nav,
body.site-theme-dark .forum-post,
body.site-theme-dark .post-box,
body.dark .forum-page .forum-category,
body.dark .forum-page .topic-row,
body.dark .thread-nav,
body.dark .forum-post,
body.dark .post-box{
  background:#0f172a!important;color:#e5edf8!important;border-color:#26344b!important;
}
body.site-theme-dark .forum-page .forum-icon,
body.site-theme-dark .forum-page .topic-icon,
body.dark .forum-page .forum-icon,
body.dark .forum-page .topic-icon{background:#17233a!important;color:#e5edf8!important;}

/* Announcements. */
body.site-theme-dark .news-list,
body.site-theme-dark .news-card,
body.dark .news-list,
body.dark .news-card{color:#e5edf8!important;}
body.site-theme-dark .news-card,
body.dark .news-card{background:#0f172a!important;border-color:#26344b!important;}

/* Marketplace. */
body.site-theme-dark .market-category-chip,
body.site-theme-dark .market-tab,
body.site-theme-dark .market-actions,
body.site-theme-dark .market-hint,
body.dark .market-category-chip,
body.dark .market-tab,
body.dark .market-actions,
body.dark .market-hint{color:#dbeafe!important;}
body.site-theme-dark .market-category-chip,
body.site-theme-dark .market-tab,
body.dark .market-category-chip,
body.dark .market-tab{background:#111c2e!important;border-color:#26344b!important;}
body.site-theme-dark .market-grid .card,
body.site-theme-dark .market-detail .card,
body.dark .market-grid .card,
body.dark .market-detail .card{background:#0f172a!important;border-color:#26344b!important;}

/* Profile + albums + wall. */
body.site-theme-dark .profile-panel,
body.site-theme-dark .profile-social-nav,
body.site-theme-dark .profile-section-nav,
body.site-theme-dark .album-card,
body.site-theme-dark .album-modal-card,
body.site-theme-dark .profile-content,
body.site-theme-dark .profile-head,
body.dark .profile-panel,
body.dark .profile-social-nav,
body.dark .profile-section-nav,
body.dark .album-card,
body.dark .album-modal-card,
body.dark .profile-content,
body.dark .profile-head{color:#e5edf8!important;}
body.site-theme-dark .profile-panel,
body.site-theme-dark .album-card,
body.site-theme-dark .album-modal-card,
body.dark .profile-panel,
body.dark .album-card,
body.dark .album-modal-card{background:#0f172a!important;border-color:#26344b!important;}
body.site-theme-dark .profile-modern .profile-tabs a,
body.site-theme-dark .profile-modern .profile-section-nav a,
body.dark .profile-modern .profile-tabs a,
body.dark .profile-modern .profile-section-nav a{color:#cbd5e1!important;}
body.site-theme-dark .contact-chip,
body.site-theme-dark .activity-item,
body.site-theme-dark .quick-panel a,
body.dark .contact-chip,
body.dark .activity-item,
body.dark .quick-panel a{background:#111c2e!important;color:#e5edf8!important;border-color:#26344b!important;}

/* People, friends, notifications, activity and rules. */
body.site-theme-dark .people-back,
body.site-theme-dark .v27-people-head,
body.site-theme-dark .notification-actions,
body.site-theme-dark .active-page .page-head,
body.site-theme-dark .rules-page,
body.dark .people-back,
body.dark .v27-people-head,
body.dark .notification-actions,
body.dark .active-page .page-head,
body.dark .rules-page{color:#e5edf8!important;}
body.site-theme-dark .rules-card,
body.site-theme-dark .v27-person,
body.site-theme-dark .notification-item,
body.site-theme-dark .active-row,
body.site-theme-dark .friend-row,
body.dark .rules-card,
body.dark .v27-person,
body.dark .notification-item,
body.dark .active-row,
body.dark .friend-row{background:#0f172a!important;border-color:#26344b!important;color:#e5edf8!important;}

/* Social / stories / monetization. */
body.site-theme-dark .social-nav,
body.site-theme-dark .feed-compose,
body.site-theme-dark .post,
body.site-theme-dark .story-hub,
body.site-theme-dark .story-create-box,
body.site-theme-dark .story-settings,
body.site-theme-dark .monet-form,
body.site-theme-dark .monet-orders,
body.dark .social-nav,
body.dark .feed-compose,
body.dark .post,
body.dark .story-hub,
body.dark .story-create-box,
body.dark .story-settings,
body.dark .monet-form,
body.dark .monet-orders{background:#0f172a!important;color:#e5edf8!important;border-color:#26344b!important;}
body.site-theme-dark .story-view,
body.dark .story-view{background:#0a1220!important;}

/* Legacy dark toggle and selected site theme must both darken the page. */
html[data-site-theme="dark"] body .mobile-nav,
body.site-theme-dark .mobile-nav,
body.dark .mobile-nav{background:#070d18!important;border-color:#26344b!important;}
html[data-site-theme="dark"] body header,
body.site-theme-dark header,
body.dark header{background:rgba(7,13,24,.96)!important;border-color:#26344b!important;color:#e5edf8!important;}

/* v158: chat gets one scrolling surface at every viewport size. */
html:has(body.chat-page:not(.profile-modern)),
body.chat-page:not(.profile-modern){overflow:hidden!important;}
body.chat-page:not(.profile-modern){height:100dvh!important;min-height:100dvh!important;}
body.chat-page:not(.profile-modern) main{height:calc(100dvh - 72px)!important;min-height:0!important;overflow:hidden!important;}
body.chat-page:not(.profile-modern) .chat-layout{height:100%!important;min-height:0!important;overflow:hidden!important;}
body.chat-page:not(.profile-modern) .chatbox{height:100%!important;min-height:0!important;overflow:hidden!important;}
body.chat-page:not(.profile-modern) #messages{height:auto!important;min-height:0!important;max-height:none!important;overflow-y:auto!important;overflow-x:hidden!important;}
@media(max-width:700px){
 body.chat-page:not(.profile-modern) main{height:calc(100dvh - 54px - 76px)!important;}
}

/* v159 — forum dark theme final fix: site-theme-dark is stored on <html>. */
html.site-theme-dark .forum-page,
html.site-theme-dark .forum-page .page-head,
html.site-theme-dark .forum-page .forum-card,
html.site-theme-dark .forum-page .topic-list,
html.site-theme-dark .forum-page .forum-category,
html.site-theme-dark .forum-page .topic-row,
html.site-theme-dark .forum-page .forum-back,
html.site-theme-dark .forum-page .new-topic,
html.site-theme-dark .thread-nav,
html.site-theme-dark .forum-post,
html.site-theme-dark .post-box {
  background:#0f172a!important;
  color:#e5edf8!important;
  border-color:#26344b!important;
}
html.site-theme-dark .forum-page .forum-category:hover,
html.site-theme-dark .forum-page .topic-row:hover {
  background:#111c2e!important;
  border-color:#3b82f6!important;
}
html.site-theme-dark .forum-page .forum-icon,
html.site-theme-dark .forum-page .topic-icon {
  background:#17233a!important;
  color:#e5edf8!important;
}
html.site-theme-dark .forum-page .topic-main small,
html.site-theme-dark .forum-page .topic-last,
html.site-theme-dark .forum-page .forum-category em,
html.site-theme-dark .forum-page .page-head p,
html.site-theme-dark .forum-page .thread-nav,
html.site-theme-dark .forum-page .forum-post small {
  color:#94a3b8!important;
}
html.site-theme-dark .forum-page input,
html.site-theme-dark .forum-page textarea,
html.site-theme-dark .forum-page select,
html.site-theme-dark .post-box textarea {
  background:#0b1322!important;
  color:#e5edf8!important;
  border-color:#26344b!important;
}
html.site-theme-dark .forum-page input::placeholder,
html.site-theme-dark .forum-page textarea::placeholder,
html.site-theme-dark .post-box textarea::placeholder {
  color:#64748b!important;
}
html.site-theme-dark .forum-page .forum-back button,
html.site-theme-dark .forum-page .secondary,
html.site-theme-dark .post-actions button,
html.site-theme-dark .forum-social-actions button,
html.site-theme-dark .thread-emoji-btn {
  background:#111c2e!important;
  color:#dbeafe!important;
  border-color:#26344b!important;
}
html.site-theme-dark .forum-page .primary,
html.site-theme-dark .forum-send-btn {
  color:#fff!important;
}
html.site-theme-dark .forum-reply-ref {
  background:#111c2e!important;
  color:#dbeafe!important;
  border-color:#3b82f6!important;
}
html.site-theme-dark .forum-user-link,
html.site-theme-dark .thread-nav a {
  color:#93c5fd!important;
}
html.site-theme-dark .forum-page .empty,
html.site-theme-dark .forum-page .error {
  color:#cbd5e1!important;
  background:#0f172a!important;
  border-color:#26344b!important;
}

@media(max-width:700px){
  html.site-theme-dark .forum-page .forum-category,
  html.site-theme-dark .forum-page .topic-row,
  html.site-theme-dark .forum-page .forum-card,
  html.site-theme-dark .forum-page .new-topic,
  html.site-theme-dark .forum-page .forum-back,
  html.site-theme-dark .thread-nav,
  html.site-theme-dark .forum-post,
  html.site-theme-dark .post-box {
    background:#0f172a!important;
    color:#e5edf8!important;
    border-color:#26344b!important;
  }
}

/* ===== v160 — mobile chat visual polish ===== */
@media (max-width:700px){
  /* Compact site header: logo row should not consume the chat viewport. */
  body.chat-page > header{
    min-height:54px!important;
    height:54px!important;
    padding:8px 12px!important;
    gap:8px!important;
    box-sizing:border-box!important;
    overflow:hidden!important;
  }
  body.chat-page > header .brand{
    font-size:17px!important;
    line-height:1!important;
    max-width:100%!important;
  }
  body.chat-page > header .brand b{font-size:17px!important;}
  body.chat-page > header .topnav{display:none!important;}

  /* Chat title area: compact and balanced. */
  body.chat-page main{
    height:calc(100dvh - 54px - 76px)!important;
  }
  .chat-page .hero{
    min-height:64px!important;
    padding:7px 10px!important;
    gap:7px!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    border-radius:0!important;
  }
  .chat-page .hero .eyebrow{font-size:8px!important;line-height:1!important;margin-bottom:3px!important;}
  .chat-page .hero h1{font-size:21px!important;line-height:1.05!important;}
  .chat-page .hero p{font-size:11px!important;line-height:1.15!important;margin:3px 0 0!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;}
  .chat-page #onlineCount{height:32px!important;min-height:32px!important;padding:4px 9px!important;font-size:13px!important;}

  /* Search bar gets a clean, shallow row. */
  .chat-page .chat-tools{
    height:52px!important;
    min-height:52px!important;
    padding:6px 10px!important;
  }
  .chat-page .chat-search input{
    height:38px!important;
    min-height:38px!important;
    border-radius:12px!important;
    font-size:14px!important;
    padding:6px 11px!important;
  }

  /* Messages: short texts make short bubbles; long texts still wrap safely. */
  .chat-page #messages{
    padding:10px 8px 150px!important;
    scrollbar-gutter:auto!important;
  }
  .chat-page #messages .message{
    width:100%!important;
    padding:0 4px!important;
    margin:7px 0!important;
  }
  .chat-page #messages .chat-bubble{
    width:max-content!important;
    max-width:min(82%,520px)!important;
    min-width:0!important;
    padding:8px 10px 7px!important;
    border-radius:15px 15px 15px 5px!important;
    box-shadow:0 3px 10px rgba(0,0,0,.16)!important;
  }
  .chat-page #messages .message.me .chat-bubble{
    border-radius:15px 15px 5px 15px!important;
  }
  .chat-page #messages .chat-userline,
  .chat-page #messages .msg-head{gap:6px!important;margin-bottom:1px!important;}
  .chat-page #messages .chat-userline .avatar,
  .chat-page #messages .msg-head .avatar{
    width:27px!important;height:27px!important;min-width:27px!important;
  }
  .chat-page #messages .chat-userline b,
  .chat-page #messages .msg-head b{font-size:13px!important;}
  .chat-page #messages .chat-userline small,
  .chat-page #messages .msg-head small{font-size:9px!important;}
  .chat-page #messages .chat-bubble p{
    margin:4px 0 0!important;
    font-size:15px!important;
    line-height:1.32!important;
  }
  .chat-page #messages .reactions{
    margin-top:5px!important;
    gap:3px!important;
  }
  .chat-page #messages .reactions .reaction{
    min-height:25px!important;
    padding:2px 7px!important;
    border-radius:999px!important;
    font-size:12px!important;
    background:rgba(15,23,42,.14)!important;
  }

  /* Composer sits clearly above the bottom navigation instead of covering it. */
  .chat-page .v27-composer{
    left:7px!important;
    right:7px!important;
    bottom:calc(76px + env(safe-area-inset-bottom))!important;
    padding:4px!important;
    z-index:1200!important;
  }
  .chat-page .v27-composer-row{
    grid-template-columns:minmax(0,1fr) repeat(4,36px)!important;
    gap:4px!important;
    min-height:46px!important;
    padding:4px!important;
    border-radius:15px!important;
  }
  .chat-page .v27-composer #text{
    min-height:36px!important;
    max-height:68px!important;
    padding:7px 8px!important;
    font-size:14px!important;
    border-radius:10px!important;
  }
  .chat-page .v27-composer-row .chat-tool-btn,
  .chat-page .v27-composer-row .v27-emoji-btn,
  .chat-page .v27-composer-row .v27-send{
    width:36px!important;
    min-width:36px!important;
    max-width:36px!important;
    height:36px!important;
    min-height:36px!important;
    border-radius:10px!important;
    font-size:17px!important;
  }

  /* Bottom navigation is compact and all five labels remain visible. */
  body.chat-page .mobile-nav{
    height:76px!important;
    min-height:76px!important;
    padding:5px 3px calc(5px + env(safe-area-inset-bottom))!important;
    box-sizing:border-box!important;
  }
  body.chat-page .mobile-nav a{
    min-width:0!important;
    padding:3px 1px!important;
    font-size:10px!important;
    line-height:1.05!important;
    overflow:hidden!important;
  }
  body.chat-page .mobile-nav a:first-line{font-size:22px!important;}
  body.chat-page .mobile-nav a span{
    display:block!important;
    margin-top:2px!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }
  body.chat-page .mobile-nav a.active{font-weight:800!important;}

  /* Reaction/action popup stays attached to the bubble and never creates a wide block. */
  .chat-page #messages .msg-hover-tools{
    max-width:calc(100vw - 24px)!important;
    min-height:34px!important;
    border-radius:13px!important;
    padding:3px 5px!important;
  }
}


/* ===== v160 CHAT DESKTOP FINAL LAYOUT =====
   Keep the composer inside the visible chat card, make the left rail a
   real scrollable panel, and prevent the card border from being exceeded. */
@media (min-width:701px){
  body.chat-page main{
    overflow:visible!important;
  }
  body.chat-page .chat-layout{
    height:clamp(450px,calc(100vh - 315px),680px)!important;
    min-height:450px!important;
    align-items:stretch!important;
  }
  body.chat-page .users-panel{
    height:100%!important;
    min-height:0!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
  }
  body.chat-page .chatbox{
    height:100%!important;
    min-height:0!important;
    overflow:hidden!important;
  }
  body.chat-page #messages{
    flex:1 1 auto!important;
    min-height:0!important;
    max-height:none!important;
    overflow-y:auto!important;
  }
  body.chat-page .v27-composer{
    flex:0 0 auto!important;
    position:relative!important;
    margin:0!important;
    padding:8px!important;
    background:var(--card,#fff)!important;
    border-top:1px solid var(--line)!important;
    z-index:20!important;
  }
  body.chat-page .v27-composer-row{
    width:100%!important;
    min-height:52px!important;
    box-sizing:border-box!important;
  }
  body.chat-page .v27-composer #text{
    min-height:42px!important;
    max-height:110px!important;
  }
  body.chat-page .v27-emoji-panel{
    bottom:62px!important;
  }
  body.dark.chat-page .v27-composer,
  html[data-site-theme="dark"] body.chat-page .v27-composer{
    background:#0f172a!important;
    border-top-color:#263448!important;
  }
}

/* Keep the left navigation frame intact even when the list is long. */
body.chat-page .users-panel .sidebar-section{
  min-width:0!important;
  box-sizing:border-box!important;
}
body.chat-page .users-panel .quick-btn,
body.chat-page .users-panel .all-chat{
  box-sizing:border-box!important;
}

/* The site name already identifies the project; no duplicate page label. */
body.chat-page > header .brand span{display:none!important;}

/* ===== v162 DESKTOP CHAT — FULL HEIGHT / NO SIDEBAR SCROLL ===== */
@media (min-width:901px){
  body.chat-page{overflow-y:auto!important;overflow-x:hidden!important;}
  .chat-page main{
    width:min(1380px,calc(100% - 24px))!important;
    height:calc(100dvh - 64px)!important;
    min-height:0!important;
    margin:0 auto!important;
    padding:8px 0 10px!important;
    box-sizing:border-box!important;
    display:flex!important;
    flex-direction:column!important;
  }
  .chat-page .site-welcome,
  .chat-page .site-ad{
    flex:0 0 auto!important;
    margin-bottom:6px!important;
    padding:8px 12px!important;
  }
  .chat-page .pinned-rules{
    flex:0 0 auto!important;
    margin-bottom:6px!important;
    padding:8px 12px!important;
  }
  .chat-page .hero{
    flex:0 0 auto!important;
    padding:5px 2px 7px!important;
    margin:0!important;
    min-height:42px!important;
  }
  .chat-page .hero h1{font-size:24px!important;margin:2px 0!important;}
  .chat-page .hero p{font-size:12px!important;margin:0!important;}
  .chat-page .chat-layout{
    flex:1 1 auto!important;
    height:auto!important;
    min-height:0!important;
    width:100%!important;
    align-items:stretch!important;
  }
  .chat-page .users-panel{
    height:auto!important;
    min-height:0!important;
    overflow:visible!important;
    padding:12px!important;
    box-sizing:border-box!important;
  }
  .chat-page .users-list{
    max-height:none!important;
    height:auto!important;
    overflow:visible!important;
  }
  .chat-page .sidebar-section{margin:10px 0 12px!important;gap:5px!important;}
  .chat-page .users-panel .all-chat,
  .chat-page .users-panel .quick-btn{min-height:38px!important;padding:8px 10px!important;}
  .chat-page .chatbox{
    height:auto!important;
    min-height:0!important;
    overflow:hidden!important;
  }
  .chat-page #messages{
    flex:1 1 auto!important;
    min-height:0!important;
    max-height:none!important;
    overflow-y:auto!important;
    padding:10px 14px!important;
  }
}


/* v163: make quoted/replied message text readable on own blue bubbles */
.chat-page #messages .message.me .reply-preview{
  background:rgba(0,0,0,.24)!important;
  border-left:3px solid rgba(255,255,255,.95)!important;
  color:#fff!important;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.10)!important;
}
.chat-page #messages .message.me .reply-preview span{
  color:rgba(255,255,255,.82)!important;
  font-weight:700!important;
}
.chat-page #messages .message.me .reply-preview b{
  color:#fff!important;
  font-weight:900!important;
}
.chat-page #messages .message.me .reply-preview p{
  color:rgba(255,255,255,.96)!important;
  opacity:1!important;
  font-weight:500!important;
}


/* v164 — slightly taller desktop chat window: more messages visible */
@media (min-width:701px){
  body.chat-page .chat-layout{
    height:clamp(500px,calc(100vh - 255px),740px)!important;
    min-height:500px!important;
  }
  body.chat-page .chatbox{
    height:100%!important;
    min-height:0!important;
  }
  body.chat-page #messages{
    flex:1 1 auto!important;
    min-height:0!important;
    max-height:none!important;
    overflow-y:auto!important;
  }
}
/* v164 — duplicate home stories tray is intentionally hidden; header stories remain */
.home-page .story-top-tray,
body:not(.chat-page) .story-top-tray{display:none!important;}


/* v165: chat home link + dark voice button */
.chat-page .topnav a[href="home.php"]{
  font-weight:800!important;
}
.chat-page .v27-composer-row .chat-tool-btn#voiceBtn{
  background:#172230!important;
  color:#f1f5f9!important;
  border:1px solid #334155!important;
  box-shadow:0 2px 8px rgba(0,0,0,.22)!important;
}
.chat-page .v27-composer-row .chat-tool-btn#voiceBtn:hover{
  background:#223044!important;
  border-color:#475569!important;
}
body.dark.chat-page .v27-composer-row .chat-tool-btn#voiceBtn,
html[data-site-theme="dark"] body.chat-page .v27-composer-row .chat-tool-btn#voiceBtn{
  background:#1b2633!important;
  color:#f8fafc!important;
  border-color:#3b4b60!important;
}

/* v165.1 voice playback protection: keep message actions away from native audio controls */
.message:has(.voice-msg) .msg-hover-tools{
  position:relative!important;
  top:auto!important;
  right:auto!important;
  left:auto!important;
  inset:auto!important;
  margin-top:7px!important;
  transform:none!important;
  z-index:5!important;
  width:100%!important;
  max-width:100%!important;
  box-sizing:border-box!important;
  justify-content:flex-start!important;
}
.message:has(.voice-msg) .voice-msg{
  position:relative!important;
  z-index:10!important;
  width:100%!important;
  max-width:100%!important;
  box-sizing:border-box!important;
  overflow:visible!important;
}
.message:has(.voice-msg) .voice-msg audio{
  position:relative!important;
  z-index:20!important;
  display:block!important;
  width:min(320px,100%)!important;
  max-width:100%!important;
  min-width:0!important;
}
.message:has(.voice-msg) .msg-hover-tools .quick-reactions{
  position:relative!important;
  z-index:30!important;
}
@media(max-width:900px){
  .message:has(.voice-msg) .msg-hover-tools{margin-top:6px!important;padding:0!important;overflow:visible!important}
  .message:has(.voice-msg) .voice-msg audio{width:100%!important;max-width:100%!important}
}


/* v166 ADMIN PRO compact dashboard + period stats fix */
.admin-page main{max-width:1400px;margin:0 auto;padding:18px 20px 34px;box-sizing:border-box}
.admin-page .hero{margin-bottom:14px}
.admin-page .admin-pro-tabs{position:sticky;top:8px;z-index:120;display:flex;gap:7px;flex-wrap:wrap;padding:9px;margin:0 0 14px;border:1px solid var(--line);border-radius:16px;background:var(--card);box-shadow:0 8px 26px rgba(0,0,0,.08)}
.admin-page .admin-pro-tabs .protab{flex:0 0 auto;min-height:38px;padding:8px 11px;border-radius:10px;white-space:nowrap}
.admin-page .protab-content{width:100%;min-width:0;box-sizing:border-box}
.admin-page .protab-content>.card,.admin-page .protab-content>.admin-card{width:100%;max-width:100%;box-sizing:border-box;overflow:visible}
.admin-dashboard{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(320px,.65fr);gap:14px;align-items:start}
.admin-dashboard>#dashStats{grid-column:1/-1}
.admin-dashboard>.card:nth-of-type(1){grid-column:1}
.admin-dashboard>.admin-period-card{grid-column:2;grid-row:2}
.admin-dashboard .admin-period-card{min-width:0;overflow:visible}
.admin-card-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:4px}
.admin-card-head h2{margin:0;min-width:0}
.admin-period-card .pro-inline{margin:0;display:flex;align-items:center;gap:8px;flex-wrap:nowrap}
.admin-period-card .pro-inline select{min-width:125px}
.admin-period-result{min-height:28px;margin-top:8px;padding:9px 11px;border-radius:10px;background:var(--card2);color:var(--muted);box-sizing:border-box;overflow-wrap:anywhere}
.admin-page .admin-stats.pro-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-bottom:0}
.admin-page .admin-stats.pro-stats>div{min-width:0;padding:14px;border-radius:14px;box-sizing:border-box;overflow:hidden}
.admin-page .admin-stats.pro-stats b{display:block;font-size:22px;line-height:1.1;overflow-wrap:anywhere}
.admin-page .admin-stats.pro-stats span{display:block;margin-top:5px;white-space:normal;overflow-wrap:anywhere}
.admin-page .pro-form{min-width:0}
.admin-page textarea,.admin-page input,.admin-page select{max-width:100%;box-sizing:border-box}
@media(max-width:1050px){.admin-dashboard{grid-template-columns:1fr}.admin-dashboard>.admin-period-card{grid-column:1;grid-row:auto}.admin-page .admin-stats.pro-stats{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:700px){.admin-page main{padding:10px 10px 26px}.admin-page .admin-pro-tabs{position:sticky;top:4px;padding:7px;overflow-x:auto;flex-wrap:nowrap;scrollbar-width:none}.admin-page .admin-pro-tabs::-webkit-scrollbar{display:none}.admin-page .admin-pro-tabs .protab{min-width:max-content}.admin-page .admin-stats.pro-stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.admin-page .admin-stats.pro-stats>div{padding:10px}.admin-page .admin-stats.pro-stats b{font-size:19px}.admin-card-head{align-items:stretch}.admin-period-card .pro-inline{width:100%;display:grid;grid-template-columns:1fr auto}.admin-period-card .pro-inline select{width:100%;min-width:0}.admin-period-card .pro-inline button{white-space:nowrap}.admin-page .hero{padding:16px}.admin-page .hero h1{font-size:24px}.admin-page .hero p{font-size:13px}}
@media(max-width:420px){.admin-page .admin-stats.pro-stats{grid-template-columns:1fr 1fr}.admin-page .admin-stats.pro-stats>div{min-height:72px}.admin-period-card .pro-inline{grid-template-columns:1fr}.admin-period-card .pro-inline button{width:100%}}

/* v168 — stable chat height + admin crown alignment */
@media (min-width:701px){
  body.chat-page .chat-layout{
    height:clamp(560px,calc(100dvh - 225px),760px)!important;
    min-height:560px!important;
    max-height:760px!important;
  }
  body.chat-page .chatbox{height:100%!important;min-height:0!important;}
  body.chat-page #messages{flex:1 1 auto!important;min-height:0!important;max-height:none!important;overflow-y:auto!important;}
}
.chat-page .profile-mini b,
.chat-page .chat-userline,
.chat-page .msg-head{line-height:1.2!important;}
.chat-page .profile-mini b .admin-badge,
.chat-page .chat-userline .admin-badge,
.chat-page .msg-head .admin-badge{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  height:1em!important;
  width:1em!important;
  font-size:.95em!important;
  line-height:1!important;
  vertical-align:-.05em!important;
  position:static!important;
  top:auto!important;
  transform:none!important;
  margin:0 3px 0 0!important;
  padding:0!important;
  flex:0 0 auto!important;
}


/* v169 — compact admin dashboard, stable taller chat, clean online list, no global story tray */
.global-story-tray{display:none!important;}

/* Stories remain available from the dedicated navigation item and on story.php itself. */
body.story-page .story-top-tray{display:flex!important;}

.admin-page .admin-dashboard>.card:first-of-type,
.admin-page .admin-dashboard>.admin-period-card{
  padding:14px 16px!important;
  border-radius:16px!important;
}
.admin-page .admin-dashboard>.card:first-of-type h2,
.admin-page .admin-period-card h2{font-size:17px!important;line-height:1.2!important;}
.admin-page .admin-dashboard>.card:first-of-type .pro-inline{display:grid!important;grid-template-columns:minmax(0,1fr) 42px!important;gap:8px!important;align-items:center!important;}
.admin-page .admin-dashboard #myLogin{height:40px!important;min-width:0!important;}
.admin-page .admin-icon-action{
  width:42px!important;height:40px!important;min-width:42px!important;
  padding:0!important;margin:0!important;border-radius:11px!important;
  display:inline-flex!important;align-items:center!important;justify-content:center!important;
  font-size:18px!important;font-weight:900!important;line-height:1!important;
  background:var(--brand,#2563eb)!important;color:#fff!important;
  border:1px solid color-mix(in srgb,var(--brand,#2563eb) 70%,#000)!important;
  box-shadow:none!important;cursor:pointer!important;
}
.admin-page .admin-icon-action:hover{transform:translateY(-1px)!important;filter:brightness(1.04)!important;}
.admin-page .admin-period-card .pro-inline{gap:7px!important;}
.admin-page .admin-period-card .pro-inline select{height:40px!important;min-width:118px!important;}
.admin-page .admin-period-card .admin-icon-action{width:40px!important;min-width:40px!important;height:40px!important;}
.admin-page .admin-dashboard>.card:first-of-type .muted{margin:7px 0 0!important;font-size:11px!important;line-height:1.35!important;}
.admin-page #myLoginStatus{display:block!important;min-height:16px!important;margin-top:4px!important;font-size:11px!important;}

/* Make the online popup read as orange user chips rather than white bubbles. */
.chat-page .online-panel .online-users>a{
  background:#f97316!important;
  color:#fff!important;
  border:0!important;
  border-radius:12px!important;
  padding:7px 9px!important;
  box-shadow:none!important;
}
.chat-page .online-panel .online-users>a:hover{background:#ea580c!important;}
.chat-page .online-panel .online-users>a span:not(.online-mini-avatar),
.chat-page .online-panel .online-users>a b{color:#fff!important;text-shadow:none!important;}
.chat-page .online-panel .online-mini-avatar{
  width:34px!important;height:34px!important;min-width:34px!important;
  border-radius:9px!important;
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
  color:#fff!important;
}
.chat-page .online-panel .online-mini-avatar img{border-radius:9px!important;border:0!important;}

/* A little more vertical room in the desktop chat so F5 does not bring back the short layout. */
@media (min-width:701px){
  /* v171 — slightly extend the chat upward while keeping its bottom position */
  body.chat-page .chat-layout{
    height:clamp(620px,calc(100dvh - 166px),844px)!important;
    min-height:620px!important;
    max-height:844px!important;
    margin-top:-24px!important;
  }
  body.chat-page .chatbox{height:100%!important;min-height:0!important;}
  body.chat-page #messages{flex:1 1 auto!important;min-height:0!important;max-height:none!important;overflow-y:auto!important;}
}
@media (max-width:700px){
  .admin-page .admin-dashboard>.card:first-of-type .pro-inline{grid-template-columns:minmax(0,1fr) 40px!important;}
  .admin-page .admin-icon-action{width:40px!important;min-width:40px!important;height:40px!important;}
}

/* v170 — admin crown: exact nickname baseline */
.chat-page .profile-mini b .admin-badge,
.chat-page .chat-userline .admin-badge,
.chat-page .msg-head .admin-badge,
.profile-name-row h1 .admin-badge{
  vertical-align:baseline!important;
  position:relative!important;
  top:0!important;
  transform:none!important;
  line-height:1!important;
  display:inline!important;
  width:auto!important;
  height:auto!important;
  font-size:.95em!important;
  margin:0 3px 0 0!important;
  padding:0!important;
}


/* ===== v171-height / chat visual cleanup ===== */
/* More vertical space for the chat without changing the composer. */
@media(min-width:901px){
  .chat-page .chat-layout{
    height:760px!important;
    min-height:760px!important;
  }
  .chat-page .chatbox{
    height:100%!important;
    min-height:760px!important;
  }
  .chat-page #messages{
    min-height:0!important;
    height:auto!important;
    flex:1 1 auto!important;
    overflow-y:auto!important;
  }
}

/* Rules banner: readable separation between title and hint. */
.chat-page #pinnedRules{
  display:none;
  align-items:center!important;
  gap:8px!important;
  line-height:1.25!important;
  white-space:normal!important;
}
.chat-page #pinnedRules b{margin-right:2px!important;}
.chat-page #pinnedRules span{display:inline!important;margin-left:2px!important;}

/* Nickname + time on one clean line. */
.chat-page #messages .chat-userline>span,
.chat-page #messages .msg-head>span{
  flex-direction:row!important;
  align-items:baseline!important;
  flex-wrap:wrap!important;
  gap:7px!important;
}
.chat-page #messages .chat-userline small,
.chat-page #messages .msg-head small{
  display:inline!important;
  margin:0!important;
  flex:0 0 auto!important;
}
.chat-page #messages .chat-userline b,
.chat-page #messages .msg-head b{margin:0!important;}
.chat-page #messages .chat-userline .admin-name,
.chat-page #messages .msg-head .admin-name{
  color:var(--admin-text-color,#f59e0b)!important;
  font-weight:850!important;
}
.chat-page #messages .message.me .chat-userline .admin-name,
.chat-page #messages .message.me .msg-head .admin-name{color:#fff!important;}

/* Reply preview: never glue "Ответ на" to the nickname. */
.chat-page #messages .reply-preview{
  display:flex!important;
  align-items:baseline!important;
  flex-wrap:wrap!important;
  column-gap:6px!important;
  row-gap:2px!important;
}
.chat-page #messages .reply-preview span,
.chat-page #messages .reply-preview b{
  display:inline!important;
  margin:0!important;
}
.chat-page #messages .reply-preview p{
  flex:1 1 100%!important;
  width:100%!important;
}

/* Reaction/action tools stay transparent; no dark rectangle behind them. */
.chat-page #messages .msg-hover-tools,
.chat-page #messages .quick-reactions,
.chat-page #messages .msg-hover-tools button,
.chat-page #messages .msg-hover-tools .reaction{
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
}
.chat-page #messages .msg-hover-tools{
  padding:2px 0!important;
  gap:4px!important;
}
.chat-page #messages .quick-reactions{gap:2px!important;}
.chat-page #messages .msg-hover-tools button,
.chat-page #messages .msg-hover-tools .reaction{
  min-width:28px!important;
  height:30px!important;
  padding:4px 6px!important;
  border-radius:8px!important;
}
.chat-page #messages .msg-hover-tools button:hover,
.chat-page #messages .msg-hover-tools .reaction:hover,
.chat-page #messages .msg-hover-tools .reaction.active{
  background:rgba(127,127,127,.10)!important;
}

/* Persisted reactions under a message remain compact pills, not a large panel. */
.chat-page #messages .reactions{
  display:flex!important;
  flex-wrap:wrap!important;
  gap:4px!important;
  margin-top:6px!important;
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
  padding:0!important;
}
.chat-page #messages .reactions .reaction{
  min-width:34px!important;
  width:auto!important;
  height:28px!important;
  padding:3px 7px!important;
  border-radius:999px!important;
  background:rgba(127,127,127,.10)!important;
  border:1px solid rgba(127,127,127,.18)!important;
  box-shadow:none!important;
}
.chat-page #messages .reactions .reaction.active{
  border-color:var(--brand)!important;
}

/* Compact online dropdown. */
.chat-page .online-panel{
  width:250px!important;
  max-height:300px!important;
  padding:9px!important;
  border-radius:15px!important;
}
.chat-page .online-panel-head{padding-bottom:7px!important;}
.chat-page .online-users>a{padding:6px!important;border-radius:10px!important;}
.chat-page .online-mini-avatar{width:30px!important;height:30px!important;min-width:30px!important;}

/* No Stories tray/content inside the chat itself. */
.chat-page .global-story-tray,
.chat-page .story-tray,
.chat-page .home-stories,
.chat-page .stories-tray{display:none!important;}

@media(max-width:900px){
  .chat-page .chat-layout,
  .chat-page .chatbox{height:calc(100dvh - 62px)!important;min-height:0!important;}
}

/* v173 targeted fixes — only requested online popup + navigation corrections. */
@media (min-width:701px){
  .chat-page .online-widget{transform:translateY(-8px)!important;}
}
.chat-page .online-panel .online-users>a{
  background:transparent!important;
  color:var(--text)!important;
  border:0!important;
  box-shadow:none!important;
}
.chat-page .online-panel .online-users>a:hover{
  background:var(--card2)!important;
}
.chat-page .online-panel .online-users>a b{
  display:inline-block!important;
  padding:4px 9px!important;
  border-radius:999px!important;
  background:#f59e0b!important;
  color:#fff!important;
  font-weight:900!important;
  line-height:1.2!important;
}
.chat-page .online-panel .online-users>a span:not(.online-mini-avatar){
  color:var(--text)!important;
}
body.dark .chat-page .online-panel .online-users>a span:not(.online-mini-avatar),
html[data-theme="dark"] .chat-page .online-panel .online-users>a span:not(.online-mini-avatar){
  color:#f8fafc!important;
}

/* ===== v177 MOBILE-FIRST OPTIMIZATION =====
   Mobile is the primary viewport. Desktop rules above are intentionally left intact.
   This block only applies up to 700px and focuses on touch targets, width, safe areas,
   readable cards, and preventing horizontal overflow. */
@media (max-width:700px){
  html,body{max-width:100%;overflow-x:hidden!important;}
  body{min-width:0!important;-webkit-text-size-adjust:100%;text-rendering:optimizeLegibility;}
  *,*::before,*::after{box-sizing:border-box;}
  img,video,iframe{max-width:100%;}
  input,textarea,select,button{font:inherit;}
  button,a,[role="button"]{-webkit-tap-highlight-color:transparent;touch-action:manipulation;}
  a,button{min-height:42px;}
  p,h1,h2,h3,h4{overflow-wrap:anywhere;}

  /* Compact, scroll-safe site header. Pages that already hide the mobile topnav
     keep their existing behavior. */
  body:not(.story-page) > header{
    min-height:54px!important;
    padding:7px 10px!important;
    gap:7px!important;
    width:100%!important;
    max-width:100%!important;
    overflow:hidden!important;
  }
  body:not(.chat-page) > header .brand{
    min-width:0!important;
    max-width:45vw!important;
    overflow:hidden!important;
    white-space:nowrap!important;
    text-overflow:ellipsis!important;
    font-size:16px!important;
  }
  body:not(.chat-page) > header .brand b{font-size:16px!important;}
  body:not(.chat-page) > header .topnav,
  body:not(.chat-page) > header .profile-nav{
    min-width:0!important;
    max-width:100%!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    -webkit-overflow-scrolling:touch!important;
    scrollbar-width:none!important;
    white-space:nowrap!important;
    gap:5px!important;
  }
  body:not(.chat-page) > header .topnav::-webkit-scrollbar,
  body:not(.chat-page) > header .profile-nav::-webkit-scrollbar{display:none;}
  body:not(.chat-page) > header .topnav a,
  body:not(.chat-page) > header .profile-nav a{
    flex:0 0 auto!important;
    min-height:40px!important;
    padding:8px 9px!important;
    white-space:nowrap!important;
  }

  /* Common page frame: use the full phone width without oversized side gutters. */
  body:not(.chat-page) main{
    width:100%!important;
    max-width:100%!important;
    margin:0!important;
    padding:12px 10px calc(92px + env(safe-area-inset-bottom))!important;
  }
  .page-head,.hero,.card,.panel,.profile-panel,.forum-card,.topic-list,.news-card,
  .social-card,.admin-card,.admin-row,.market-tools,.market-tabs{
    max-width:100%!important;
    min-width:0!important;
  }
  .page-head{gap:10px!important;}
  .page-head h1,.hero h1{font-size:23px!important;line-height:1.15!important;}
  .page-head p,.hero p{font-size:13px!important;line-height:1.4!important;}

  /* Forms: no tiny controls and no accidental horizontal scroll. */
  input,textarea,select{width:100%;max-width:100%;min-width:0;}
  textarea{max-width:100%;}
  .primary,.secondary,.profile-btn,.admin-buttons button,.market-actions button,
  .album-toolbar button,.story-create-box button,.story-upload{
    min-height:42px!important;
  }

  /* Cards should breathe, but not waste phone screen space. */
  .card{border-radius:15px!important;}
  .card,.profile-panel,.forum-card,.social-card{padding:12px!important;}

  /* Market / classifieds: one clean column and comfortable controls. */
  .market-page main{padding-left:10px!important;padding-right:10px!important;}
  .market-hero{margin-bottom:10px!important;}
  .market-tools{gap:7px!important;}
  .market-tabs{gap:6px!important;margin:10px 0!important;padding-bottom:2px!important;}
  .market-tabs button{min-height:42px!important;padding:8px 12px!important;}
  .market-grid{grid-template-columns:1fr!important;gap:10px!important;}
  .market-card{width:100%!important;}
  .market-photo{height:205px!important;}
  .market-card-body{padding:12px!important;}
  .market-card h3{font-size:17px!important;line-height:1.2!important;}
  .market-card p{min-height:0!important;margin:7px 0!important;}
  .market-actions{gap:6px!important;}
  .market-actions button{flex:1 1 46%!important;min-width:0!important;}
  .market-detail{gap:12px!important;}
  .gallery-main{height:280px!important;}
  .market-form-grid{gap:8px!important;}

  /* Profile: tabs scroll horizontally, content stays one column. */
  .profile-head{grid-template-columns:1fr!important;}
  .profile-head-actions{width:100%!important;display:grid!important;grid-template-columns:1fr 1fr!important;gap:7px!important;}
  .profile-head-actions>*{width:100%!important;min-width:0!important;}
  .profile-social-nav,.profile-section-nav{
    display:flex!important;overflow-x:auto!important;flex-wrap:nowrap!important;gap:6px!important;
    scrollbar-width:none!important;-webkit-overflow-scrolling:touch!important;
    padding-bottom:3px!important;
  }
  .profile-social-nav::-webkit-scrollbar,.profile-section-nav::-webkit-scrollbar{display:none;}
  .profile-social-nav a,.profile-section-nav a{flex:0 0 auto!important;white-space:nowrap!important;min-height:40px!important;padding:9px 11px!important;}
  .edit-grid{grid-template-columns:1fr!important;gap:12px!important;}
  .edit-contact-grid{grid-template-columns:1fr!important;}

  /* Albums: retain two columns so photos remain useful on a phone. */
  .albums-grid,.album-photo-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important;}
  .album-cover{height:112px!important;}
  .album-info{padding:9px!important;}
  .album-info b{font-size:14px!important;line-height:1.2!important;}
  .album-toolbar{gap:6px!important;}
  .album-toolbar>*{flex:1 1 auto;min-width:0;}
  .album-modal{padding:6px!important;}
  .album-modal-card{width:100%!important;margin:8px auto!important;border-radius:16px!important;padding:11px!important;}
  .album-photo-actions button{min-height:40px!important;}

  /* Forum: topic rows and composer fit narrow screens without clipped controls. */
  .forum-page{width:100%!important;min-width:0!important;}
  .forum-category,.topic-row,.forum-post{width:100%!important;min-width:0!important;}
  .topic-row{grid-template-columns:auto minmax(0,1fr)!important;gap:8px!important;padding:10px!important;}
  .forum-compose-row{display:grid!important;grid-template-columns:minmax(0,1fr) 42px!important;gap:7px!important;}
  .forum-compose-row textarea{grid-column:1/-1!important;min-height:92px!important;}
  .forum-send-btn{width:100%!important;}
  .thread-emoji-btn{width:42px!important;min-width:42px!important;}

  /* Stories: large enough to tap, but compact enough to browse quickly. */
  .story-hub{padding:12px 10px calc(92px + env(safe-area-inset-bottom))!important;min-height:calc(100dvh - 54px)!important;}
  .story-hub-head{display:grid!important;grid-template-columns:1fr auto!important;gap:8px!important;}
  .story-hub-head h1{font-size:23px!important;}
  .story-create-box{padding:11px!important;border-radius:15px!important;}
  .story-create-box form{grid-template-columns:1fr!important;gap:7px!important;}
  .story-create-box input[name=caption],.story-upload,.story-create-box form>button{width:100%!important;min-height:44px!important;}
  .all-stories{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important;}
  .all-story-card{min-height:120px!important;padding:11px 7px!important;}
  .all-story-ring{width:68px!important;height:68px!important;}
  .story-media img,.story-media video{max-width:100%!important;width:auto!important;max-height:calc(100dvh - 150px)!important;}
  .story-social{gap:6px!important;}
  .story-social button{min-height:42px!important;}

  /* Admin: keep important controls and stats visible without a giant login block. */
  .admin-page main{padding:8px 8px calc(92px + env(safe-area-inset-bottom))!important;}
  .admin-page .hero{padding:12px!important;margin-bottom:9px!important;}
  .admin-page .hero h1{font-size:22px!important;}
  .admin-page .admin-pro-tabs{top:0!important;margin-bottom:9px!important;border-radius:12px!important;padding:5px!important;}
  .admin-page .admin-pro-tabs .protab{min-height:42px!important;padding:9px 10px!important;}
  .admin-dashboard{display:flex!important;flex-direction:column!important;gap:9px!important;}
  .admin-dashboard>#dashStats{order:1!important;width:100%!important;}
  .admin-dashboard>.admin-period-card{order:2!important;width:100%!important;}
  .admin-dashboard>.admin-login-card{order:3!important;width:100%!important;}
  .admin-page .admin-stats.pro-stats{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:6px!important;}
  .admin-page .admin-stats.pro-stats>div{padding:9px!important;min-height:68px!important;border-radius:12px!important;}
  .admin-page .admin-stats.pro-stats b{font-size:18px!important;}
  .admin-login-card{width:100%!important;max-width:none!important;}
  .admin-login-card .pro-inline{display:grid!important;grid-template-columns:minmax(0,1fr) 44px!important;gap:6px!important;width:100%!important;}
  .admin-login-card .pro-inline input{min-width:0!important;width:100%!important;}
  .admin-buttons{display:flex!important;flex-wrap:wrap!important;gap:6px!important;}
  .admin-buttons button{flex:1 1 auto!important;min-width:42px!important;}
  .market-admin-row{display:flex!important;flex-direction:column!important;gap:8px!important;}
  .market-admin-row>div:first-child{min-width:0!important;}

  /* Generic long admin lists become cards instead of compressed rows. */
  .admin-row{padding:10px!important;border-radius:12px!important;}

  /* Mobile bottom navigation: respect the phone's safe area and keep labels legible. */
  .mobile-nav{
    height:76px!important;
    min-height:76px!important;
    padding:5px 3px calc(5px + env(safe-area-inset-bottom))!important;
  }
  .mobile-nav a{min-height:62px!important;height:62px!important;font-size:23px!important;border-radius:12px!important;}
  .mobile-nav a span{font-size:10px!important;line-height:1.1!important;}

  /* Chat itself: maximize message viewport; do not change the composer design. */
  body.chat-page:not(.profile-modern){
    height:100dvh!important;min-height:100dvh!important;overflow:hidden!important;padding-bottom:0!important;
  }
  body.chat-page:not(.profile-modern) main{
    width:100%!important;max-width:100%!important;
    height:calc(100dvh - 54px - 76px)!important;
    min-height:0!important;padding:0 6px!important;overflow:hidden!important;
  }
  body.chat-page:not(.profile-modern) .chat-layout{
    width:100%!important;height:100%!important;min-height:0!important;display:flex!important;overflow:hidden!important;gap:6px!important;
  }
  body.chat-page:not(.profile-modern) .users-panel{
    width:36%!important;min-width:0!important;max-width:260px!important;overflow-y:auto!important;overflow-x:hidden!important;
  }
  body.chat-page:not(.profile-modern) .chatbox{width:64%!important;min-width:0!important;height:100%!important;min-height:0!important;overflow:hidden!important;}
  body.chat-page:not(.profile-modern) #messages{min-width:0!important;overflow-x:hidden!important;-webkit-overflow-scrolling:touch!important;scroll-behavior:smooth;}
  body.chat-page:not(.profile-modern) #messages .message{max-width:94%!important;}
  body.chat-page:not(.profile-modern) .online-panel{max-width:calc(100vw - 18px)!important;width:240px!important;}

  /* On very narrow phones the user rail is a drawer-like compact column. */
  @media(max-width:480px){
    body.chat-page:not(.profile-modern) .users-panel{width:31%!important;}
    body.chat-page:not(.profile-modern) .chatbox{width:69%!important;}
    body.chat-page:not(.profile-modern) .users-panel .quick-btn,
    body.chat-page:not(.profile-modern) .users-panel .all-chat{font-size:12px!important;padding:8px 6px!important;}
    .profile-head-actions{grid-template-columns:1fr!important;}
  }

  /* Prevent fixed/sticky widgets from covering the last content above the nav. */
  body:not(.chat-page) main > :last-child{scroll-margin-bottom:92px;}
}


/* v178 — targeted fixes only: online user row + compact desktop admin dashboard. */
@media (min-width:701px){
  .chat-page .online-widget{position:relative!important;z-index:1000!important;}
  .chat-page .online-panel{z-index:1100!important;}
  .chat-page .online-user-row{position:relative!important;z-index:1101!important;display:flex!important;align-items:center!important;gap:9px!important;}
}
.chat-page .online-panel .online-mini-avatar{
  position:relative!important;
  display:grid!important;
  place-items:center!important;
  flex:0 0 30px!important;
  width:30px!important;height:30px!important;min-width:30px!important;
  overflow:hidden!important;
}
.chat-page .online-panel .online-mini-avatar img{
  display:block!important;
  width:100%!important;height:100%!important;
  object-fit:cover!important;
}
.chat-page .online-panel .online-avatar-fallback{
  width:100%!important;height:100%!important;
  display:grid!important;place-items:center!important;
  border-radius:50%!important;
  background:rgba(255,255,255,.18)!important;
  color:#fff!important;
  font-size:16px!important;
}
.chat-page .online-panel .online-user-name{
  display:flex!important;align-items:center!important;min-width:0!important;
}
.chat-page .online-panel .online-user-name b{
  display:inline-block!important;
  padding:4px 9px!important;
  border-radius:999px!important;
  background:#f59e0b!important;
  color:#fff!important;
  font-weight:900!important;
  line-height:1.2!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  max-width:180px!important;
}
@media (min-width:701px){
  .admin-page .admin-dashboard{
    grid-template-columns:minmax(0,1.45fr) minmax(260px,.55fr)!important;
    align-items:start!important;
  }
  .admin-page .admin-dashboard>#dashStats{
    grid-column:1!important;
    grid-row:1!important;
    width:100%!important;
    box-sizing:border-box!important;
  }
  .admin-page .admin-dashboard>.admin-login-card{
    grid-column:2!important;
    grid-row:1!important;
    width:100%!important;
    max-width:360px!important;
    justify-self:end!important;
    box-sizing:border-box!important;
  }
  .admin-page .admin-dashboard>.admin-period-card{
    grid-column:1/-1!important;
    grid-row:2!important;
    width:100%!important;
    box-sizing:border-box!important;
  }
  .admin-page .admin-stats.pro-stats{
    grid-template-columns:repeat(4,minmax(110px,1fr))!important;
  }
}

/* v179 — only requested online positioning and desktop admin dashboard layout. */
@media (min-width:701px){
  .chat-page .online-widget{transform:translateY(-15px)!important;}
  .chat-page .online-toggle{padding:6px 10px!important;font-size:13px!important;line-height:1.1!important;}
}
.chat-page .online-panel .online-users>a .online-user-name{
  background:transparent!important;border:0!important;box-shadow:none!important;padding:0!important;margin:0!important;
  display:inline-flex!important;align-items:center!important;min-width:0!important;
}
.chat-page .online-panel .online-users>a .online-user-name b{
  background:#f59e0b!important;color:#fff!important;border:0!important;box-shadow:none!important;
  padding:4px 9px!important;border-radius:999px!important;display:inline-block!important;
}
@media (min-width:701px){
  .admin-page .admin-dashboard{grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;gap:12px!important;align-items:start!important;}
  .admin-page .admin-dashboard>#dashStats{grid-column:1 / -1!important;grid-row:1!important;width:100%!important;}
  .admin-page .admin-dashboard>.admin-login-card{grid-column:1!important;grid-row:2!important;width:100%!important;max-width:420px!important;justify-self:start!important;box-sizing:border-box!important;}
  .admin-page .admin-dashboard>.admin-period-card{grid-column:2!important;grid-row:2!important;width:100%!important;max-width:420px!important;justify-self:start!important;box-sizing:border-box!important;}
  .admin-page .admin-dashboard>.admin-login-card,.admin-page .admin-dashboard>.admin-period-card{padding:14px 16px!important;min-height:0!important;border-radius:16px!important;}
  .admin-page .admin-dashboard>.admin-period-card .admin-card-head{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:10px!important;}
  .admin-page .admin-dashboard>.admin-period-card .admin-card-head h2{margin:0!important;font-size:17px!important;white-space:nowrap!important;}
}


/* v180 — unified online indicator: tiny dot just above/right of nickname. */
.user-online-dot{display:inline-block!important;width:7px!important;height:7px!important;min-width:7px!important;border-radius:50%!important;background:#94a3b8!important;vertical-align:super!important;margin-left:5px!important;position:relative!important;top:-1px!important;box-shadow:0 0 0 1px rgba(255,255,255,.12)!important;}
.user-online-dot.is-online{background:#22c55e!important;box-shadow:0 0 0 2px rgba(34,197,94,.14),0 0 7px rgba(34,197,94,.45)!important;}
.chat-userline .user-online-dot,.msg-head .user-online-dot,.profile-name-row .user-online-dot{width:6px!important;height:6px!important;min-width:6px!important;}
@media(max-width:700px){.user-online-dot{width:6px!important;height:6px!important;min-width:6px!important;margin-left:4px!important;}}


/* v182 — targeted online click + admin statistics reliability */
.chat-page .hero{position:relative!important;isolation:isolate!important;}
.chat-page .hero>div:first-child{position:relative!important;z-index:1!important;}
.chat-page .hero .online-widget{position:relative!important;z-index:100000!important;isolation:isolate!important;pointer-events:auto!important;}
.chat-page .hero #onlineCount{position:relative!important;z-index:100001!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;pointer-events:auto!important;touch-action:manipulation!important;-webkit-tap-highlight-color:transparent!important;}
.chat-page .hero #onlinePanel{position:absolute!important;z-index:100002!important;pointer-events:auto!important;}
.admin-page .admin-period-stats{display:grid;grid-template-columns:repeat(4,minmax(100px,1fr));gap:8px;margin:8px 0;}
.admin-page .admin-period-stats>div{padding:10px 12px;border:1px solid var(--line);border-radius:12px;background:var(--card2);box-sizing:border-box;}
.admin-page .admin-period-stats b{display:block;font-size:18px;line-height:1.1;}
.admin-page .admin-period-stats span{display:block;margin-top:3px;font-size:11px;color:var(--muted);}
@media(max-width:700px){.admin-page .admin-period-stats{grid-template-columns:repeat(2,minmax(0,1fr));}.admin-page .admin-period-stats>div{padding:9px;}}

/* v183 — targeted mobile fixes from device screenshot: full-width chat,
   fully scrollable personal page, and no duplicate online-button toggle. */
@media(max-width:700px){
  /* The mobile chat uses the bottom navigation; do not reserve a desktop
     users rail that squeezes the actual chat to ~2/3 of the phone width. */
  body.chat-page:not(.profile-modern) .chat-layout{
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    height:100%!important;
    min-height:0!important;
    margin:0!important;
    overflow:hidden!important;
  }
  body.chat-page:not(.profile-modern) .users-panel{display:none!important;}
  body.chat-page:not(.profile-modern) .chatbox{
    display:flex!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    height:100%!important;
    min-height:0!important;
    margin:0!important;
    box-sizing:border-box!important;
  }

  /* Profile pages inherit chat-page for the shared header. Override only
     the mobile viewport lock so the whole personal page can scroll. */
  body.chat-page.profile-modern{
    height:auto!important;
    min-height:100dvh!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    padding-bottom:70px!important;
  }
  body.chat-page.profile-modern main.profile-shell{
    width:100%!important;
    max-width:100%!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    margin:0!important;
    padding:8px 8px 80px!important;
    overflow:visible!important;
    box-sizing:border-box!important;
  }
  body.chat-page.profile-modern #profileCard{
    width:100%!important;
    max-width:100%!important;
    min-height:0!important;
    height:auto!important;
    overflow:hidden!important;
    box-sizing:border-box!important;
  }
  body.chat-page.profile-modern .profile-content,
  body.chat-page.profile-modern .profile-main-col,
  body.chat-page.profile-modern .profile-side,
  body.chat-page.profile-modern .profile-panel{
    min-height:0!important;
    max-height:none!important;
  }
}


/* v184 smart notifications + mobile badge cleanup */
.notification-settings{margin:0 0 16px}.notification-settings>p{color:var(--muted)}.notification-settings>button{margin-top:12px}.notification-settings #notificationSettingsStatus{margin-left:9px;color:#16a34a;font-weight:800}.notification-setting{display:flex;align-items:center;gap:10px;padding:11px 12px;border:1px solid var(--line);border-radius:13px;background:var(--card2);cursor:pointer}.notification-setting input{width:18px;height:18px;accent-color:var(--brand)}.notification-setting span{display:block}.notification-setting small{display:block;color:var(--muted);margin-top:2px}.notification-settings #notificationSettingsGrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.cover-size-hint{align-self:center;color:var(--muted);font-size:11px;font-weight:700}.smart-notify-toast{position:fixed;right:18px;bottom:82px;z-index:10050;display:flex;align-items:flex-start;gap:10px;max-width:min(380px,calc(100vw - 28px));padding:12px 14px;border:1px solid var(--line);border-radius:16px;background:var(--card);color:var(--text);box-shadow:0 18px 50px rgba(0,0,0,.28);cursor:pointer;animation:smartToastIn .2s ease}.smart-notify-toast b{display:block}.smart-notify-toast small{display:block;color:var(--muted);margin-top:3px}@keyframes smartToastIn{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
@media(max-width:700px){.notification-settings #notificationSettingsGrid{grid-template-columns:1fr}.smart-notify-toast{right:10px;bottom:74px;max-width:calc(100vw - 20px)}.mobile-nav .forum-new-badge,.mobile-nav .ann-new-badge,.mobile-nav .market-new-badge{display:none!important}}
/* v184: bottom navigation uses a real numeric notification badge, never a red dot. */
@media(max-width:700px){.mobile-nav .global-notify-badge{background:var(--brand)!important;color:#fff!important;border:2px solid var(--card,#fff)!important;min-width:18px!important;height:18px!important;line-height:14px!important;border-radius:999px!important;font-size:9px!important;box-shadow:none!important}.mobile-nav .forum-new-badge,.mobile-nav .ann-new-badge,.mobile-nav .market-new-badge{display:none!important}}


/* v185 — targeted mobile notification/profile/market cleanup */
@media(max-width:700px){
  /* No red/blue numeric dots or badges over the bottom navigation. */
  .mobile-nav .global-notify-badge,
  .mobile-nav .forum-new-badge,
  .mobile-nav .ann-new-badge,
  .mobile-nav .market-new-badge{display:none!important;}
}

/* Profile statistics: keep labels inside their cards instead of dropping/overflowing. */
.profile-modern .profile-stats .stat-link,
.profile-modern .profile-stats div{min-width:0!important;overflow:hidden!important;box-sizing:border-box!important;}
.profile-modern .profile-stats .stat-link span,
.profile-modern .profile-stats div span{display:block!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;line-height:1.2!important;}
.profile-modern .profile-stats .stat-link b,
.profile-modern .profile-stats div b{white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;line-height:1.15!important;}

/* Marketplace: edit/delete/other owner controls stay dark in dark themes. */
body.site-theme-dark .market-actions button:not(.primary),
body.dark .market-actions button:not(.primary),
body.dark-preload .market-actions button:not(.primary){
  background:#111827!important;
  color:#e5edf8!important;
  border:1px solid #26344b!important;
}
body.site-theme-dark .market-actions button:not(.primary):hover,
body.dark .market-actions button:not(.primary):hover,
body.dark-preload .market-actions button:not(.primary):hover{background:#17233a!important;color:#fff!important;}

/* v190 — visual polish only: desktop + mobile, no functional changes */
:root{
  --glass:rgba(255,255,255,.68);
  --glass-strong:rgba(255,255,255,.86);
  --glow:0 0 0 1px rgba(96,165,250,.10),0 18px 55px rgba(15,23,42,.10);
  --ease:cubic-bezier(.22,.8,.25,1);
}

/* 13 — restrained glass surfaces */
header,.chat-tools,.composer,.mobile-nav,
.badges .online,.online-panel,.smart-notify-toast,
.admin-pro-tabs,.profile-tabs{
  -webkit-backdrop-filter:blur(18px) saturate(125%);
  backdrop-filter:blur(18px) saturate(125%);
}
header{background:var(--glass)!important;box-shadow:0 8px 35px rgba(15,23,42,.05)}
.users-panel,.chatbox,.forum-card,.topic-list,.card,.profile-card,.admin-card,.rules-card,.profile-panel{
  box-shadow:var(--glow);
  transition:transform .22s var(--ease),box-shadow .22s var(--ease),border-color .22s var(--ease);
}
.users-panel:hover,.chatbox:hover,.forum-card:hover,.topic-list:hover,.card:hover,.profile-card:hover,.admin-card:hover,.rules-card:hover,.profile-panel:hover{
  box-shadow:0 20px 60px rgba(15,23,42,.12);
}

/* 14 — polished controls with clear press/focus states */
button,.topnav a,.theme-btn,.quick-btn,.all-chat,.profile-btn,.protab,.secondary,.primary,.composer button,.auth button{
  transition:transform .16s var(--ease),box-shadow .16s var(--ease),background .16s var(--ease),border-color .16s var(--ease),color .16s var(--ease);
}
button:hover,.topnav a:hover,.theme-btn:hover,.profile-btn:hover,.protab:hover,.primary:hover,.secondary:hover,.composer button:hover,.auth button:hover{transform:translateY(-1px)}
button:active,.topnav a:active,.theme-btn:active,.profile-btn:active,.protab:active,.primary:active,.secondary:active,.composer button:active,.auth button:active{transform:translateY(1px) scale(.985)}
button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline:3px solid rgba(56,189,248,.28);outline-offset:2px}

/* 2/6/9/10/11 — unified visual language */
.message-body,.msg-body{transition:transform .18s var(--ease),box-shadow .18s var(--ease)}
.message-body:hover,.msg-body:hover{transform:translateY(-1px);box-shadow:0 12px 30px rgba(15,23,42,.08)}
.avatar,.profile-avatar-xl{box-shadow:0 8px 28px rgba(15,23,42,.12)}
.profile-avatar-xl{transition:transform .22s var(--ease),box-shadow .22s var(--ease)}
.profile-avatar-xl:hover{transform:translateY(-2px) scale(1.015);box-shadow:0 20px 48px rgba(15,23,42,.2)}
.profile-stats div,.activity-item,.contact-chip,.social-links a,.forum-category,.topic-row{transition:transform .18s var(--ease),box-shadow .18s var(--ease),border-color .18s var(--ease)}
.profile-stats div:hover,.activity-item:hover,.contact-chip:hover,.social-links a:hover{transform:translateY(-2px);box-shadow:0 10px 26px rgba(15,23,42,.07)}

/* 18 — mobile app feel */
@media(max-width:700px){
  html,body{width:100%;max-width:100%;overflow-x:hidden}
  body{padding-bottom:calc(70px + env(safe-area-inset-bottom))!important}
  header{position:sticky!important;top:0!important;padding:10px 10px!important}
  main{width:100%!important;max-width:100%!important;padding-left:10px!important;padding-right:10px!important}
  .topnav{width:100%;overflow-x:auto;flex-wrap:nowrap;justify-content:flex-start;scrollbar-width:none;padding-bottom:2px}
  .topnav::-webkit-scrollbar{display:none}
  .topnav a,.theme-btn{flex:0 0 auto}
  .chat-layout{width:100%!important;grid-template-columns:1fr!important;gap:10px!important}
  .chatbox{width:100%!important;min-width:0!important;border-radius:18px!important}
  #messages,.messages{width:100%!important;box-sizing:border-box!important}
  .composer{width:100%!important;box-sizing:border-box!important;padding:9px!important;gap:6px!important}
  .composer textarea{min-width:0!important}
  .mobile-nav{height:auto!important;min-height:62px!important;padding:6px 4px calc(6px + env(safe-area-inset-bottom))!important;border-radius:18px 18px 0 0}
  .mobile-nav a{min-height:50px!important;border-radius:14px!important}
  .mobile-nav a.active{background:rgba(37,99,235,.10)!important}
  .profile-shell{width:100%!important;max-width:100%!important;margin:8px auto 30px!important;padding:0!important}
  .profile-content{grid-template-columns:1fr!important;padding:10px!important}
  .profile-head{grid-template-columns:auto 1fr!important;padding:0 14px 18px!important;gap:12px!important}
  .profile-head-actions{grid-column:1/-1!important;padding-bottom:0!important;flex-wrap:wrap}
  .profile-head-actions .profile-btn{flex:1 1 140px}
  .profile-cover{height:145px!important}
  .profile-avatar-xl{width:100px!important;height:100px!important;border-radius:28px!important}
  .profile-name-row h1{font-size:24px!important}
  .profile-stats{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  .profile-stats div{padding:11px 8px!important}
  .profile-stats b{font-size:19px!important}
}

/* 20 — lightweight skeleton shimmer for existing loading placeholders */
.profile-loading,.loading,.global-story-tray-loading{position:relative;overflow:hidden}
.profile-skeleton{background:linear-gradient(90deg,var(--card2) 20%,var(--line) 50%,var(--card2) 80%)!important;background-size:220% 100%!important;animation:pcSkeleton 1.25s ease-in-out infinite}
@keyframes pcSkeleton{0%{background-position:220% 0}100%{background-position:-20% 0}}

/* 25 — micro-interactions */
@keyframes pcSoftIn{from{opacity:0;transform:translateY(5px)}to{opacity:1;transform:none}}
.chatbox,.profile-card,.forum-card,.topic-list,.market-card,.news-card{animation:pcSoftIn .34s var(--ease) both}
.notification-item,.smart-notify-toast{animation:pcSoftIn .22s var(--ease) both}
.user-online-dot.is-online{animation:pcOnlinePulse 2.2s ease-in-out infinite}
@keyframes pcOnlinePulse{0%,100%{box-shadow:0 0 0 0 rgba(34,197,94,.18)}50%{box-shadow:0 0 0 4px rgba(34,197,94,.08)}}

/* 12 — deeper ocean dark theme */
body.dark,body.site-theme-dark,html[data-site-theme="dark"] body{
  --bg:#060d18;--card:#0b1627;--card2:#0f1d31;--text:#e8f3ff;--muted:#8ea4bc;--line:#20334c;
  background:radial-gradient(circle at 15% -10%,rgba(14,116,144,.20),transparent 32%),radial-gradient(circle at 100% 15%,rgba(37,99,235,.14),transparent 30%),#060d18!important;
}
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 .profile-panel,
body.site-theme-dark .users-panel,body.site-theme-dark .chatbox,body.site-theme-dark .forum-card,body.site-theme-dark .topic-list,body.site-theme-dark .card,body.site-theme-dark .profile-card,body.site-theme-dark .admin-card,body.site-theme-dark .rules-card,body.site-theme-dark .profile-panel{
  background:rgba(11,22,39,.86)!important;border-color:#20334c!important;
}
body.dark .secondary,body.dark .admin-pro-tabs .protab:not(.active),body.site-theme-dark .secondary,body.site-theme-dark .admin-pro-tabs .protab:not(.active){background:#0d1a2c!important;color:#dcecff!important;border-color:#29405d!important}

/* Admin action buttons: confirmations stay dark in dark theme, never white. */
body.dark .admin-card button:not(.primary):not(.protab.active),body.site-theme-dark .admin-card button:not(.primary):not(.protab.active),
body.dark .admin-page button.admin-icon-action,body.site-theme-dark .admin-page button.admin-icon-action{background:#101d30!important;color:#e5edf8!important;border:1px solid #29405d!important}

@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.01ms!important}}


/* v191 — targeted fixes from mobile screenshots. Keep visual redesign intact. */
/* Mobile composer: controls stay physically inside the composer row. */
@media (max-width:700px){
  body.chat-page:not(.profile-modern) .chatbox{
    display:flex!important;
    flex-direction:column!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    height:100%!important;
    min-height:0!important;
    overflow:hidden!important;
  }
  body.chat-page:not(.profile-modern) #messages{
    flex:1 1 auto!important;
    min-height:0!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    padding-bottom:8px!important;
  }
  body.chat-page:not(.profile-modern) .v27-composer{
    position:relative!important;
    inset:auto!important;
    left:auto!important;
    right:auto!important;
    bottom:auto!important;
    width:100%!important;
    max-width:100%!important;
    flex:0 0 auto!important;
    margin:0!important;
    padding:6px 7px calc(6px + env(safe-area-inset-bottom))!important;
    box-sizing:border-box!important;
    z-index:1200!important;
    background:var(--card,#0b1627)!important;
    border-top:1px solid var(--line,#20334c)!important;
  }
  body.chat-page:not(.profile-modern) .v27-composer-row{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) repeat(4,38px)!important;
    align-items:center!important;
    gap:4px!important;
    width:100%!important;
    min-height:50px!important;
    margin:0!important;
    padding:4px!important;
    box-sizing:border-box!important;
    border:1px solid var(--line,#20334c)!important;
    border-radius:16px!important;
    background:var(--card2,#0f1d31)!important;
  }
  body.chat-page:not(.profile-modern) .v27-composer-row #text{
    grid-column:1!important;
    width:100%!important;
    min-width:0!important;
    min-height:38px!important;
    max-height:76px!important;
    margin:0!important;
    box-sizing:border-box!important;
  }
  body.chat-page:not(.profile-modern) .v27-composer-row #voiceBtn,
  body.chat-page:not(.profile-modern) .v27-composer-row .v27-emoji-btn,
  body.chat-page:not(.profile-modern) .v27-composer-row .composer-photo-btn,
  body.chat-page:not(.profile-modern) .v27-composer-row .v27-send{
    position:static!important;
    align-self:center!important;
    justify-self:stretch!important;
    width:38px!important;
    min-width:38px!important;
    max-width:38px!important;
    height:38px!important;
    min-height:38px!important;
    max-height:38px!important;
    margin:0!important;
    transform:none!important;
    box-sizing:border-box!important;
  }
}

/* Profile statistics: zero values remain visible and labels never disappear. */
.profile-modern .profile-stats{
  display:grid!important;
  width:100%!important;
  min-width:0!important;
  box-sizing:border-box!important;
}
.profile-modern .profile-stats .stat-link{
  display:flex!important;
  flex-direction:column!important;
  align-items:flex-start!important;
  justify-content:center!important;
  min-width:0!important;
  width:100%!important;
  box-sizing:border-box!important;
  overflow:hidden!important;
  text-decoration:none!important;
}
.profile-modern .profile-stats .stat-link b,
.profile-modern .profile-stats .stat-link span{
  display:block!important;
  visibility:visible!important;
  opacity:1!important;
  max-width:100%!important;
  min-width:0!important;
}
.profile-modern .profile-stats .stat-link b{font-variant-numeric:tabular-nums;}

/* No unexplained red dot beside profile/forum links. Real notifications live in the bell/toast. */
.profile-modern .profile-stats .forum-new-badge,
.profile-modern .profile-stats .global-notify-badge,
.forum-unread-badge{display:none!important;}
@media(max-width:700px){
  .mobile-nav .global-notify-badge,
  .mobile-nav .forum-new-badge,
  .mobile-nav .ann-new-badge,
  .mobile-nav .market-new-badge{display:none!important;}
}

/* v192 — targeted desktop fix: online indicator must stay inside the chat header.
   Do not alter mobile positioning or any other chat settings. */
@media (min-width:701px){
  .chat-page .hero .online-widget{
    transform:none!important;
    position:relative!important;
    top:auto!important;
    right:auto!important;
    bottom:auto!important;
    margin:0!important;
    align-self:center!important;
    z-index:10!important;
  }
  .chat-page .hero .online-toggle{
    transform:none!important;
  }
}

/* ===== v193 visual polish: Primchat modern ocean UI ===== */
:root{
  --pc-radius-xl:24px;
  --pc-radius-lg:20px;
  --pc-radius-md:16px;
  --pc-glass:rgba(255,255,255,.78);
  --pc-glass-border:rgba(255,255,255,.62);
  --pc-shadow:0 16px 42px rgba(15,23,42,.10);
}
body:not(.dark){background:radial-gradient(circle at 8% 0%,rgba(14,165,233,.08),transparent 30%),radial-gradient(circle at 92% 8%,rgba(20,184,166,.07),transparent 28%),#f6f9fc;}
body:not(.dark) header{backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);background:rgba(255,255,255,.82)!important;box-shadow:0 8px 28px rgba(15,23,42,.06);}
.topnav a,.theme-btn{transition:transform .16s ease,background .16s ease,box-shadow .16s ease,color .16s ease;}
.topnav a:hover,.theme-btn:hover{transform:translateY(-1px);}
.card,.users-panel,.chatbox,.forum-card,.topic-list,.rules-card,.profile-card,.admin-card,.market-card,.city-card,.city-event,.home73card,.service73,.v73-home,.market-detail,.seller-box{box-shadow:var(--pc-shadow);transition:box-shadow .2s ease,transform .2s ease,border-color .2s ease;}
.card:hover,.forum-category:hover,.topic-row:hover,.market-card:hover,.city-card:hover,.city-event:hover,.home73card:hover{box-shadow:0 20px 46px rgba(15,23,42,.13);}
.forum-category,.topic-row,.market-card,.city-card,.city-event,.home73card,.service73{border-radius:var(--pc-radius-lg)!important;}
.forum-icon,.topic-icon{border-radius:16px!important;box-shadow:inset 0 0 0 1px rgba(37,99,235,.08);}
button,.primary,.secondary,.profile-btn,.market-actions a,.market-actions button{transition:transform .14s ease,box-shadow .16s ease,filter .16s ease,background .16s ease;}
button:active,.primary:active,.secondary:active,.profile-btn:active,.market-actions a:active,.market-actions button:active{transform:translateY(1px) scale(.985);}
.primary,.profile-btn.primary{box-shadow:0 8px 20px rgba(37,99,235,.18);}
.dark .card,.dark .users-panel,.dark .chatbox,.dark .forum-card,.dark .topic-list,.dark .rules-card,.dark .profile-card,.dark .admin-card,.dark .market-card,.dark .city-card,.dark .city-event,.dark .home73card,.dark .service73,.dark .market-detail,.dark .seller-box,
html[data-theme="dark"] .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"] .rules-card,html[data-theme="dark"] .profile-card,html[data-theme="dark"] .admin-card,html[data-theme="dark"] .market-card,html[data-theme="dark"] .city-card,html[data-theme="dark"] .city-event,html[data-theme="dark"] .home73card,html[data-theme="dark"] .service73,html[data-theme="dark"] .market-detail,html[data-theme="dark"] .seller-box{background:linear-gradient(145deg,rgba(17,28,46,.96),rgba(10,19,33,.96));border-color:rgba(96,165,250,.12);box-shadow:0 18px 48px rgba(0,0,0,.24);}
.dark .forum-category,.dark .topic-row,.dark .market-card,.dark .city-card,.dark .city-event,.dark .home73card,.dark .service73{background:rgba(15,27,44,.88);}
.chat-bubble{box-shadow:0 8px 24px rgba(15,23,42,.08);transition:box-shadow .18s ease,transform .18s ease;}
.message:hover .chat-bubble{box-shadow:0 12px 30px rgba(15,23,42,.12);}
.dark .chat-bubble{box-shadow:0 10px 28px rgba(0,0,0,.22);}
.profile-cover,.profile-head,.profile-card{border-radius:var(--pc-radius-xl)!important;}
.profile-stats>div,.profile-stats>a{border-radius:16px!important;transition:transform .18s ease,background .18s ease,box-shadow .18s ease;}
.profile-stats>div:hover,.profile-stats>a:hover{transform:translateY(-2px);box-shadow:0 10px 26px rgba(15,23,42,.08);}
.market-photo img,.gallery-main img,.city-photo img,.album-cover img,.album-photo img{transition:transform .35s ease,filter .35s ease;}
.market-card:hover .market-photo img,.city-card:hover .city-photo img,.album-card:hover .album-cover img{transform:scale(1.025);}
.market-vip{box-shadow:0 0 0 1px rgba(245,158,11,.35),0 12px 34px rgba(245,158,11,.10)!important;}
.market-top-crown{filter:drop-shadow(0 3px 8px rgba(245,158,11,.28));}
.city-hero,.market-hero{border-radius:var(--pc-radius-xl)!important;overflow:hidden;box-shadow:0 20px 50px rgba(15,23,42,.12);}
.site-welcome,.site-ad,.pinned-rules{border-radius:18px!important;box-shadow:0 10px 28px rgba(15,23,42,.07);}
@media(max-width:700px){
  :root{--pc-radius-xl:20px;--pc-radius-lg:17px;}
  header{position:sticky!important;top:0;z-index:1000;}
  .card,.users-panel,.chatbox,.forum-card,.topic-list,.rules-card,.profile-card,.admin-card,.market-card,.city-card,.city-event,.home73card,.service73,.market-detail,.seller-box{box-shadow:0 10px 28px rgba(15,23,42,.08);}
  .topnav a,.theme-btn{min-height:38px;}
  .chat-bubble{box-shadow:0 5px 18px rgba(15,23,42,.07);}
  .market-grid,.city-grid{gap:10px!important;}
  .market-card,.city-card,.home73card{overflow:hidden;}
  .profile-stats>div,.profile-stats>a{min-height:58px;}
}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important;}}

/* ===== v194 visual pass: section polish + mobile-first ===== */
:root{
  --pc-ease:cubic-bezier(.22,.61,.36,1);
  --pc-ring:0 0 0 1px rgba(37,99,235,.08),0 18px 48px rgba(15,23,42,.10);
}

/* Unified navigation */
.topnav a,.mobile-nav a,.theme-btn{transition:transform .18s var(--pc-ease),background .18s var(--pc-ease),box-shadow .18s var(--pc-ease),color .18s var(--pc-ease)}
.topnav a:hover,.mobile-nav a:hover,.theme-btn:hover{transform:translateY(-1px)}
.topnav a:active,.mobile-nav a:active,.theme-btn:active,button:active{transform:translateY(0) scale(.98)}

/* Chat: cleaner bubbles without changing controls/logic */
.chatbox .messages{scroll-behavior:smooth}
.message .chat-bubble,.message-body,.msg-body{box-shadow:0 7px 24px rgba(15,23,42,.055);transition:box-shadow .18s var(--pc-ease),transform .18s var(--pc-ease)}
.message.me .chat-bubble,.message.mine .chat-bubble{box-shadow:0 9px 28px rgba(37,99,235,.16)}
.message:hover .chat-bubble{transform:translateY(-1px)}
.chat-userline b,.msg-head b{letter-spacing:-.01em}
.reply-preview{border-radius:11px!important;padding:7px 9px!important;margin:6px 0!important;background:rgba(127,127,127,.07)!important;border-left:3px solid rgba(37,99,235,.55)!important}
body.dark .reply-preview,html[data-theme="dark"] .reply-preview{background:rgba(255,255,255,.045)!important;border-left-color:#60a5fa!important}

/* Profiles: stronger hierarchy and touch-friendly stats */
.profile-modern .profile-cover{background-size:cover;box-shadow:inset 0 -70px 90px rgba(0,0,0,.18)}
.profile-modern .profile-panel,.profile-modern .profile-card{box-shadow:var(--pc-ring)}
.profile-stats div{transition:transform .18s var(--pc-ease),box-shadow .18s var(--pc-ease),border-color .18s var(--pc-ease)}
.profile-stats div:hover{transform:translateY(-2px);box-shadow:0 10px 26px rgba(15,23,42,.08);border-color:rgba(37,99,235,.28)}
.profile-tabs a{transition:color .18s ease,background .18s ease,border-color .18s ease}
.profile-tabs a:hover{background:var(--card2);border-radius:10px 10px 0 0}

/* Forum: readable topic/category cards */
.forum-category,.topic-row,.active-row{transition:transform .18s var(--pc-ease),box-shadow .18s var(--pc-ease),border-color .18s var(--pc-ease)}
.forum-category:hover,.topic-row:hover,.active-row:hover{transform:translateY(-2px);box-shadow:0 12px 30px rgba(15,23,42,.08)}
.topic-icon,.forum-icon{box-shadow:inset 0 0 0 1px rgba(37,99,235,.08)}

/* Albums / galleries */
.album-card,.album-cover,.album-photo,.gallery-card{border-radius:18px;overflow:hidden}
.album-card{background:var(--card);border:1px solid var(--line);box-shadow:0 10px 30px rgba(15,23,42,.07);transition:transform .2s var(--pc-ease),box-shadow .2s var(--pc-ease),border-color .2s ease}
.album-card:hover{transform:translateY(-3px);box-shadow:0 18px 42px rgba(15,23,42,.12);border-color:rgba(37,99,235,.24)}
.album-cover,.album-photo{background:var(--card2)}

/* Notifications */
.notification-item{border:1px solid transparent;border-radius:15px;margin:5px 0;padding:13px 14px;transition:background .18s ease,border-color .18s ease,transform .18s ease}
.notification-item:hover{background:var(--card2);border-color:var(--line);transform:translateX(2px)}
.notification-item.unread{border-color:rgba(37,99,235,.18)}
.notification-icon{width:40px;height:40px;display:grid;place-items:center;border-radius:13px;background:rgba(37,99,235,.09);flex:0 0 auto}

/* Market */
.market-card{transition:transform .2s var(--pc-ease),box-shadow .2s var(--pc-ease),border-color .2s ease}
.market-card:hover{transform:translateY(-3px);box-shadow:0 20px 42px rgba(15,23,42,.13);border-color:rgba(37,99,235,.22)}
.market-card-body{min-width:0}
.market-price{font-weight:900;letter-spacing:-.02em}
.market-contact{min-height:42px}

/* City */
.city-card,.city-event,.city-service,.city-photo-card{transition:transform .2s var(--pc-ease),box-shadow .2s var(--pc-ease),border-color .2s ease}
.city-card:hover,.city-event:hover,.city-service:hover,.city-photo-card:hover{transform:translateY(-2px);box-shadow:0 16px 36px rgba(15,23,42,.10)}
.city-photo img,.city-card img,.gallery-main img{transition:transform .35s var(--pc-ease),filter .35s ease}
.city-photo:hover img,.city-card:hover img{transform:scale(1.025)}

/* Stories: premium tray, no functional changes */
.stories-tray,.story-tray{scrollbar-width:none}
.stories-tray::-webkit-scrollbar,.story-tray::-webkit-scrollbar{display:none}
.story-item,.story-card{transition:transform .18s var(--pc-ease),filter .18s ease}
.story-item:hover,.story-card:hover{transform:translateY(-2px)}

/* Cards / glass consistency */
.card,.rules-card,.forum-card,.topic-list,.profile-panel,.admin-card,.market-card,.album-card{backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px)}
body.dark .card,body.dark .rules-card,body.dark .forum-card,body.dark .topic-list,body.dark .profile-panel,body.dark .admin-card,body.dark .market-card,body.dark .album-card,
html[data-theme="dark"] .card,html[data-theme="dark"] .rules-card,html[data-theme="dark"] .forum-card,html[data-theme="dark"] .topic-list,html[data-theme="dark"] .profile-panel,html[data-theme="dark"] .admin-card,html[data-theme="dark"] .market-card,html[data-theme="dark"] .album-card{background:rgba(15,23,42,.82)}

/* Mobile-first: preserve width, prevent floating controls and horizontal overflow */
@media(max-width:700px){
  html,body{max-width:100%;overflow-x:hidden}
  main,.container,.page,.content,.profile-shell{max-width:100%;box-sizing:border-box}
  .chatbox{border-radius:18px!important;min-height:0!important}
  .messages{min-width:0!important;width:100%!important}
  .message{max-width:100%!important}
  .message .chat-bubble{max-width:min(86vw,520px)!important}
  .message.me .chat-bubble,.message.mine .chat-bubble{max-width:min(86vw,520px)!important}
  .composer{position:sticky;bottom:0;z-index:30;gap:6px;padding:8px!important;box-sizing:border-box!important}
  .composer textarea{min-height:42px!important;max-height:100px!important;font-size:15px!important}
  .composer button,.composer-photo-btn{min-height:42px!important;height:42px!important}
  .msg-hover-tools{max-width:calc(100vw - 24px)!important}
  .forum-category,.topic-row,.active-row{transform:none!important}
  .forum-category:active,.topic-row:active,.active-row:active{transform:scale(.99)!important}
  .market-grid{grid-template-columns:1fr!important;gap:12px!important}
  .market-photo{height:190px!important}
  .market-card-body{padding:13px!important}
  .notification-item{margin:4px 0;padding:11px!important}
  .notification-icon{width:36px;height:36px;border-radius:11px}
  .profile-cover{height:150px!important}
  .profile-head{gap:10px!important;padding:0 14px 18px!important;margin-top:-48px!important}
  .profile-avatar-xl{width:104px!important;height:104px!important;border-width:5px!important}
  .profile-name-row h1{font-size:24px!important}
  .profile-content{padding:10px!important}
  .profile-panel{padding:15px!important;border-radius:17px!important}
  .profile-stats{gap:7px!important;margin:12px 0!important}
  .profile-stats div{padding:11px!important;border-radius:13px!important}
  .profile-stats b{font-size:20px!important}
  .profile-stats span{font-size:11px!important}
  .album-grid,.gallery-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important}
  .album-card{border-radius:14px!important}
  .topnav{gap:3px!important;padding-bottom:2px}
  .topnav a,.theme-btn{padding:8px 9px!important;font-size:13px!important}
  .mobile-nav{backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);padding-bottom:max(6px,env(safe-area-inset-bottom))!important}
  .mobile-nav a{min-height:48px!important}
}

@media(max-width:430px){
  .message .chat-bubble,.message.me .chat-bubble,.message.mine .chat-bubble{max-width:88vw!important}
  .profile-stats{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  .profile-stats div{padding:9px 6px!important}
  .profile-stats b{font-size:18px!important}
  .profile-stats span{font-size:10px!important}
  .album-grid,.gallery-grid{gap:6px!important}
  .market-photo{height:170px!important}
}

@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important}
}

/* v197 — mobile navigation: no blinking decorative red dots. Only the real
   unread counter on the Notifications item may be displayed. */
@media(max-width:700px){
  .mobile-nav .forum-new-badge,
  .mobile-nav .ann-new-badge,
  .mobile-nav .market-new-badge{display:none!important;}
  .mobile-nav .global-notify-badge{
    animation:none!important;
    position:absolute!important;
    top:2px!important;
    right:calc(50% - 24px)!important;
    display:none;
    pointer-events:none!important;
  }
  .mobile-nav a[href="notifications.php"] .global-notify-badge:not(:empty){display:inline-flex!important;}
}

/* v197 — mobile bottom navigation: no blinking dots; show only a stable unread count */
@media (max-width:700px){
  .mobile-nav .global-notify-badge,
  .mobile-nav .forum-new-badge,
  .mobile-nav .ann-new-badge,
  .mobile-nav .market-new-badge{display:none!important;animation:none!important;}
  .mobile-nav .mobile-notify-count{display:inline-flex!important;position:absolute!important;top:2px!important;right:calc(50% - 25px)!important;min-width:18px!important;height:18px!important;padding:0 5px!important;align-items:center!important;justify-content:center!important;border-radius:999px!important;background:var(--brand,#2563eb)!important;color:#fff!important;border:2px solid var(--card,#fff)!important;font:800 10px/14px Arial,sans-serif!important;box-shadow:none!important;pointer-events:none!important;animation:none!important;}
}

/* ===== v198 — targeted chat layout polish only ===== */
/* Desktop: give the actual chat more room without changing other sections. */
@media(min-width:901px){
  .chat-page .chat-layout{
    grid-template-columns:250px minmax(0,1fr)!important;
    gap:14px!important;
  }
  .chat-page .users-panel{
    min-height:700px!important;
    padding:13px!important;
  }
  .chat-page .chatbox{
    min-height:700px!important;
    height:700px!important;
  }
  .chat-page #messages{
    min-height:0!important;
    max-height:none!important;
    padding:14px 16px!important;
  }
  .chat-page .message{
    max-width:92%!important;
    margin:8px 0!important;
  }
  .chat-page .message.me{
    margin-left:auto!important;
  }
  .chat-page .message .chat-bubble{
    max-width:min(760px,100%)!important;
  }
  .chat-page .chat-tools{
    padding:9px 12px!important;
  }
  .chat-page .chat-search input{
    height:40px!important;
  }
  .chat-page .v27-composer{
    padding:8px 10px 10px!important;
  }
  .chat-page .v27-composer-row{
    min-height:54px!important;
    padding:6px 7px!important;
  }
  .chat-page .v27-composer #text{
    min-height:42px!important;
  }
  .chat-page .online-widget{
    margin-right:8px!important;
    transform:translateY(-3px)!important;
  }
}

/* Keep the online control visually attached to the chat header. */
.chat-page .hero .online-widget{align-self:center!important;position:relative!important;z-index:40!important}
.chat-page .hero .online-toggle{white-space:nowrap!important}

/* Mobile: only chat sizing/overflow; preserve the existing mobile navigation and settings. */
@media(max-width:900px){
  .chat-page .chat-layout{width:100%!important;max-width:100%!important}
  .chat-page .chatbox{width:100%!important;max-width:100%!important}
}
@media(max-width:640px){
  .chat-page .chatbox{min-height:calc(100dvh - 115px)!important;height:auto!important}
  .chat-page #messages{width:100%!important;max-width:100%!important;overflow-x:hidden!important}
  .chat-page .v27-composer{width:100%!important;max-width:100%!important}
  .chat-page .v27-composer-row{width:100%!important;max-width:100%!important}
  .chat-page .hero .online-widget{align-self:flex-start!important;margin-left:auto!important;margin-right:0!important;transform:none!important}
}

/* v199 — targeted fixes only: dark admin save buttons + desktop online control. */
body.dark .admin-page .pro-form button:not(.primary),
body.site-theme-dark .admin-page .pro-form button:not(.primary),
html[data-site-theme="dark"] body .admin-page .pro-form button:not(.primary),
body.dark .admin-page .card button:not(.primary):not(.protab):not(.protab.active),
body.site-theme-dark .admin-page .card button:not(.primary):not(.protab):not(.protab.active),
html[data-site-theme="dark"] body .admin-page .card button:not(.primary):not(.protab):not(.protab.active){
  background:#101d30!important;
  color:#e5edf8!important;
  border:1px solid #29405d!important;
  box-shadow:none!important;
}
body.dark .admin-page .pro-form button:not(.primary):hover,
body.site-theme-dark .admin-page .pro-form button:not(.primary):hover,
html[data-site-theme="dark"] body .admin-page .pro-form button:not(.primary):hover,
body.dark .admin-page .card button:not(.primary):not(.protab):not(.protab.active):hover,
body.site-theme-dark .admin-page .card button:not(.primary):not(.protab):not(.protab.active):hover,
html[data-site-theme="dark"] body .admin-page .card button:not(.primary):not(.protab):not(.protab.active):hover{
  background:#172a43!important;
  color:#fff!important;
}

@media (min-width:701px){
  /* Keep the online control above the chat area, never on top of it. */
  .chat-page .hero{overflow:visible!important;}
  .chat-page .hero .online-widget{
    position:absolute!important;
    top:-18px!important;
    right:0!important;
    margin:0!important;
    transform:none!important;
    z-index:100000!important;
    pointer-events:auto!important;
  }
  .chat-page .hero #onlineCount{
    position:relative!important;
    z-index:100001!important;
  }
  .chat-page .hero #onlinePanel{
    position:absolute!important;
    top:calc(100% + 8px)!important;
    right:0!important;
    z-index:100002!important;
    opacity:1!important;
    visibility:visible!important;
    background:var(--card,#0b1627)!important;
    background-color:var(--card,#0b1627)!important;
    color:var(--text,#e8f3ff)!important;
    border:1px solid var(--line,#20334c)!important;
    box-shadow:0 18px 50px rgba(0,0,0,.45)!important;
    backdrop-filter:none!important;
    -webkit-backdrop-filter:none!important;
  }
  .chat-page .hero #onlinePanel[hidden]{display:none!important;}
}


/* v200 — targeted online placement only. The control sits in the gap between
   the pinned bar/header and the chat area; the dropdown is fully opaque and
   above the chat, never underneath it. */
.chat-page .online-slot{
  position:relative!important;
  display:flex!important;
  justify-content:flex-end!important;
  align-items:center!important;
  min-height:38px!important;
  height:38px!important;
  margin:0 0 6px!important;
  padding:0 2px!important;
  z-index:100000!important;
}
.chat-page .online-slot .online-widget{
  position:relative!important;
  top:auto!important;
  right:auto!important;
  margin:0!important;
  transform:none!important;
  z-index:100001!important;
  pointer-events:auto!important;
}
.chat-page .online-slot #onlinePanel{
  position:absolute!important;
  top:calc(100% + 6px)!important;
  right:0!important;
  z-index:100002!important;
  opacity:1!important;
  visibility:visible!important;
  display:block!important;
  background:#0b1627!important;
  background-color:#0b1627!important;
  color:#f1f5f9!important;
  border:1px solid #294563!important;
  box-shadow:0 18px 50px rgba(0,0,0,.58)!important;
  backdrop-filter:none!important;
  -webkit-backdrop-filter:none!important;
}
.chat-page .online-slot #onlinePanel[hidden]{display:none!important;}
.chat-page .online-slot #onlinePanel .online-users,
.chat-page .online-slot #onlinePanel .online-panel-head{position:relative!important;z-index:1!important;}

@media(max-width:700px){
  .chat-page .online-slot{
    min-height:34px!important;
    height:34px!important;
    margin:0 0 4px!important;
    padding:0!important;
  }
  .chat-page .online-slot .online-widget{margin-left:auto!important;}
  .chat-page .online-slot #onlinePanel{
    right:0!important;
    top:calc(100% + 4px)!important;
    width:min(300px,calc(100vw - 16px))!important;
    max-height:300px!important;
  }
}

/* v201 — online control occupies a real slot between pinned content and chat tools. */
.chat-page .chatbox > .online-slot{
  position:relative!important;
  display:flex!important;
  justify-content:flex-end!important;
  align-items:center!important;
  width:100%!important;
  min-height:42px!important;
  height:42px!important;
  margin:0!important;
  padding:2px 10px 2px 10px!important;
  box-sizing:border-box!important;
  z-index:120!important;
  overflow:visible!important;
}
.chat-page .chatbox > .online-slot .online-widget{
  position:relative!important;
  top:auto!important;
  right:auto!important;
  bottom:auto!important;
  left:auto!important;
  margin:0!important;
  transform:none!important;
  z-index:121!important;
  isolation:isolate!important;
}
.chat-page .chatbox > .online-slot #onlinePanel{
  position:absolute!important;
  top:calc(100% + 5px)!important;
  right:10px!important;
  left:auto!important;
  width:min(360px,calc(100% - 20px))!important;
  max-height:min(420px,60vh)!important;
  overflow:auto!important;
  box-sizing:border-box!important;
  z-index:999999!important;
  opacity:1!important;
  visibility:visible!important;
  background:#0b1627!important;
  background-color:#0b1627!important;
  color:#f1f5f9!important;
  border:1px solid #294563!important;
  box-shadow:0 18px 50px rgba(0,0,0,.65)!important;
  backdrop-filter:none!important;
  -webkit-backdrop-filter:none!important;
}
.chat-page .chatbox > .online-slot #onlinePanel[hidden]{display:none!important;}
.chat-page .chatbox > .online-slot #onlinePanel .online-users,
.chat-page .chatbox > .online-slot #onlinePanel .online-panel-head{position:relative!important;z-index:1!important;}
@media(max-width:700px){
  .chat-page .chatbox > .online-slot{
    min-height:38px!important;
    height:38px!important;
    padding:1px 6px!important;
  }
  .chat-page .chatbox > .online-slot #onlinePanel{
    right:6px!important;
    width:min(300px,calc(100vw - 16px))!important;
    max-height:300px!important;
  }
}


/* v202 — online control: place it in the free gap above the chat; keep the
   dropdown independent from the chat scrolling/overflow surface. */
@media (min-width:701px){
  .chat-page .chatbox > .online-slot{
    position:relative!important;
    top:-52px!important;
    margin-bottom:-52px!important;
    min-height:42px!important;
    height:42px!important;
    z-index:2000!important;
    overflow:visible!important;
  }
  .chat-page .chatbox > .online-slot .online-widget{
    position:relative!important;
    z-index:2001!important;
    transform:none!important;
  }
  .chat-page .chatbox > .online-slot #onlinePanel{
    position:fixed!important;
    width:min(360px,calc(100vw - 20px))!important;
    max-height:min(420px,60vh)!important;
    overflow:auto!important;
    z-index:2147483000!important;
    opacity:1!important;
    visibility:visible!important;
    background:#0b1627!important;
    background-color:#0b1627!important;
    color:#f1f5f9!important;
    border:1px solid #294563!important;
    box-shadow:0 18px 50px rgba(0,0,0,.72)!important;
    backdrop-filter:none!important;
    -webkit-backdrop-filter:none!important;
  }
  .chat-page .chatbox > .online-slot #onlinePanel[hidden]{display:none!important;}
  .chat-page .chatbox > .online-slot #onlinePanel .online-panel-head{
    display:flex!important;align-items:center!important;justify-content:space-between!important;
    gap:10px!important;padding:10px 11px!important;color:#f8fafc!important;
    background:#0b1627!important;border-bottom:1px solid #294563!important;
  }
  .chat-page .chatbox > .online-slot #onlinePanel .online-users{display:grid!important;gap:4px!important;padding:6px!important;}
  .chat-page .chatbox > .online-slot #onlinePanel .online-users>a{
    display:flex!important;align-items:center!important;gap:9px!important;width:100%!important;
    box-sizing:border-box!important;padding:8px!important;border-radius:10px!important;
    color:#f8fafc!important;background:#101d30!important;text-decoration:none!important;
  }
  .chat-page .chatbox > .online-slot #onlinePanel .online-users>a:hover{background:#172a43!important;}
  .chat-page .chatbox > .online-slot #onlinePanel .online-user-name,
  .chat-page .chatbox > .online-slot #onlinePanel .online-user-name b{color:#f8fafc!important;min-width:0!important;}
}

/* v203 — mobile bottom navigation: never show decorative/section dots. */
@media(max-width:700px){
  .mobile-nav .global-notify-badge,
  .mobile-nav .forum-new-badge,
  .mobile-nav .ann-new-badge,
  .mobile-nav .market-new-badge{display:none!important;animation:none!important;}
  .mobile-nav .mobile-notify-count{display:none;position:absolute!important;top:2px!important;right:calc(50% - 25px)!important;min-width:18px!important;height:18px!important;padding:0 5px!important;align-items:center!important;justify-content:center!important;border-radius:999px!important;background:var(--brand,#2563eb)!important;color:#fff!important;border:2px solid var(--card,#fff)!important;font:800 10px/14px Arial,sans-serif!important;box-shadow:none!important;pointer-events:none!important;animation:none!important;}
  .mobile-nav a[href="notifications.php"] .mobile-notify-count:not(:empty){display:inline-flex!important;}
}

/* v205 — dark theme: admin confirmation/action buttons stay dark on desktop and mobile. */
body.dark .admin-page button:not(.protab.active),
body.site-theme-dark .admin-page button:not(.protab.active),
html[data-site-theme="dark"] body .admin-page button:not(.protab.active){
  background:#0b1422!important;
  color:#e8f1fb!important;
  border:1px solid #2a405b!important;
  box-shadow:none!important;
  text-shadow:none!important;
}
body.dark .admin-page button:not(.protab.active):hover,
body.site-theme-dark .admin-page button:not(.protab.active):hover,
html[data-site-theme="dark"] body .admin-page button:not(.protab.active):hover{
  background:#132238!important;
  color:#fff!important;
  border-color:#3a5878!important;
}
@media(max-width:700px){
  body.dark .admin-page button:not(.protab.active),
  body.site-theme-dark .admin-page button:not(.protab.active),
  html[data-site-theme="dark"] body .admin-page button:not(.protab.active){
    background:#0b1422!important;
    color:#e8f1fb!important;
  }
}

/* v206 — restore the online indicator without changing any other chat settings. */
.chat-page .chatbox > .online-slot{
  position:relative!important;
  display:flex!important;
  justify-content:flex-end!important;
  align-items:center!important;
  width:100%!important;
  min-height:42px!important;
  height:42px!important;
  margin:0!important;
  padding:2px 10px!important;
  box-sizing:border-box!important;
  top:auto!important;
  bottom:auto!important;
  transform:none!important;
  overflow:visible!important;
  z-index:5000!important;
}
.chat-page .chatbox > .online-slot .online-widget{
  position:relative!important;
  top:auto!important;
  right:auto!important;
  bottom:auto!important;
  left:auto!important;
  margin:0!important;
  transform:none!important;
  display:block!important;
  z-index:5001!important;
  pointer-events:auto!important;
}
.chat-page .chatbox > .online-slot #onlineCount{
  display:inline-flex!important;
  visibility:visible!important;
  opacity:1!important;
  pointer-events:auto!important;
  cursor:pointer!important;
}
.chat-page .chatbox > .online-slot #onlinePanel{
  position:fixed!important;
  width:min(360px,calc(100vw - 20px))!important;
  max-height:min(420px,60vh)!important;
  overflow:auto!important;
  z-index:2147483000!important;
  opacity:1!important;
  visibility:visible!important;
  background:#0b1627!important;
  background-color:#0b1627!important;
  color:#f1f5f9!important;
  border:1px solid #294563!important;
  box-shadow:0 18px 50px rgba(0,0,0,.72)!important;
  backdrop-filter:none!important;
  -webkit-backdrop-filter:none!important;
}
.chat-page .chatbox > .online-slot #onlinePanel[hidden]{display:none!important;}
@media(max-width:700px){
  .chat-page .chatbox > .online-slot{
    min-height:38px!important;
    height:38px!important;
    padding:1px 6px!important;
    top:auto!important;
    margin:0!important;
  }
  .chat-page .chatbox > .online-slot .online-widget{margin-left:auto!important;}
}
\n\n/* v207 — online control/list only: restore clickability and remove legacy orange nickname pills. */\n.chat-page .chatbox > .online-slot,\n.chat-page .chatbox > .online-slot .online-widget,\n.chat-page .chatbox > .online-slot #onlineCount{\n  pointer-events:auto!important;\n}\n.chat-page .chatbox > .online-slot #onlineCount{\n  position:relative!important;\n  z-index:2147482000!important;\n  cursor:pointer!important;\n  touch-action:manipulation!important;\n  -webkit-tap-highlight-color:transparent!important;\n}\n.chat-page .chatbox > .online-slot #onlinePanel{\n  position:fixed!important;\n  z-index:2147483000!important;\n  pointer-events:auto!important;\n  opacity:1!important;\n  visibility:visible!important;\n  background:#0b1627!important;\n  background-color:#0b1627!important;\n  color:#f8fafc!important;\n  border:1px solid #294563!important;\n  box-shadow:0 18px 50px rgba(0,0,0,.72)!important;\n  backdrop-filter:none!important;\n  -webkit-backdrop-filter:none!important;\n}\n.chat-page .chatbox > .online-slot #onlinePanel .online-users>a,\n.chat-page .chatbox > .online-slot #onlinePanel .online-users>a:hover,\n.chat-page .chatbox > .online-slot #onlinePanel .online-users>a:focus{\n  background:#101d30!important;\n  color:#f8fafc!important;\n  border:0!important;\n  box-shadow:none!important;\n}\n.chat-page .chatbox > .online-slot #onlinePanel .online-user-name,\n.chat-page .chatbox > .online-slot #onlinePanel .online-user-name b,\n.chat-page .chatbox > .online-slot #onlinePanel .online-users>a span:not(.online-mini-avatar),\n.chat-page .chatbox > .online-slot #onlinePanel .online-users>a small{\n  background:transparent!important;\n  color:#f8fafc!important;\n  border:0!important;\n  box-shadow:none!important;\n  text-shadow:none!important;\n  padding:0!important;\n  border-radius:0!important;\n}\n.chat-page .chatbox > .online-slot #onlinePanel .online-user-name b{\n  display:block!important;\n  font-weight:850!important;\n  line-height:1.2!important;\n  white-space:nowrap!important;\n  overflow:hidden!important;\n  text-overflow:ellipsis!important;\n}\n.chat-page .chatbox > .online-slot #onlinePanel .online-mini-avatar{\n  background:#172a43!important;\n}\n@media(max-width:700px){\n  .chat-page .chatbox > .online-slot #onlinePanel{\n    width:min(320px,calc(100vw - 20px))!important;\n    max-height:min(360px,60vh)!important;\n  }\n}\n
/* v208 — mobile only: keep online indicator on the right and show only real numeric new-item badges. */
@media(max-width:700px){
  .chat-page .chatbox > .online-slot{
    display:flex!important;
    justify-content:flex-end!important;
    align-items:center!important;
    width:100%!important;
    padding-left:6px!important;
    padding-right:8px!important;
  }
  .chat-page .chatbox > .online-slot .online-widget{
    margin-left:auto!important;
    margin-right:0!important;
    float:none!important;
    left:auto!important;
    right:auto!important;
    transform:none!important;
  }
  .chat-page .chatbox > .online-slot #onlineCount{
    margin-left:auto!important;
    margin-right:0!important;
  }
  /* Never show decorative dots in the mobile bottom navigation. */
  .mobile-nav .forum-new-badge,
  .mobile-nav .ann-new-badge,
  .mobile-nav .market-new-badge,
  .mobile-nav .global-notify-badge{
    display:none!important;
    animation:none!important;
  }
  /* Numeric badges are created only when the corresponding endpoint reports new items. */
  .mobile-nav .mobile-section-count{
    display:none;
    position:absolute!important;
    top:2px!important;
    right:calc(50% - 25px)!important;
    min-width:18px!important;
    height:18px!important;
    padding:0 5px!important;
    align-items:center!important;
    justify-content:center!important;
    border-radius:999px!important;
    background:#2563eb!important;
    color:#fff!important;
    border:2px solid var(--card,#fff)!important;
    font:800 10px/14px Arial,sans-serif!important;
    box-shadow:none!important;
    pointer-events:none!important;
    animation:none!important;
  }
  .mobile-nav .mobile-section-count.is-visible{display:inline-flex!important;}
}


/* v209 — desktop chat height + robust online control click. Only chat layout is affected. */
@media(min-width:901px){
  .chat-page .chat-layout{
    min-height:820px!important;
    height:820px!important;
  }
  .chat-page .chatbox{
    min-height:820px!important;
    height:820px!important;
    position:relative!important;
    isolation:isolate!important;
  }
  .chat-page .chatbox > .online-slot{
    position:relative!important;
    z-index:2147482000!important;
    pointer-events:auto!important;
  }
  .chat-page .chatbox > .online-slot .online-widget,
  .chat-page .chatbox > .online-slot #onlineCount{
    position:relative!important;
    z-index:2147483000!important;
    pointer-events:auto!important;
    cursor:pointer!important;
  }
}
.chat-page .chatbox > .online-slot{touch-action:manipulation!important;}
.chat-page .chatbox > .online-slot #onlineCount{user-select:none!important;-webkit-user-select:none!important;}


/* v210 — ONLY requested fixes: dark admin confirmation buttons + clickable online control. */
html.site-theme-dark body.admin-page button:not(.protab.active),
html[data-site-theme="dark"] body.admin-page button:not(.protab.active),
body.dark.admin-page button:not(.protab.active),
body.site-theme-dark.admin-page button:not(.protab.active){
  background:#0b1422!important;
  color:#e8f1fb!important;
  border:1px solid #2a405b!important;
  box-shadow:none!important;
  text-shadow:none!important;
}
html.site-theme-dark body.admin-page button:not(.protab.active):hover,
html[data-site-theme="dark"] body.admin-page button:not(.protab.active):hover,
body.dark.admin-page button:not(.protab.active):hover,
body.site-theme-dark.admin-page button:not(.protab.active):hover{
  background:#132238!important;
  color:#fff!important;
  border-color:#3a5878!important;
}

/* Online indicator stays in the slot between pinned content and the chat.
   It remains on the right on phones and its list is fully opaque/clickable. */
.chat-page .chatbox > .online-slot{
  justify-content:flex-end!important;
  pointer-events:auto!important;
  overflow:visible!important;
}
.chat-page .chatbox > .online-slot .online-widget,
.chat-page .chatbox > .online-slot #onlineCount{
  pointer-events:auto!important;
  cursor:pointer!important;
  touch-action:manipulation!important;
}
.chat-page .chatbox > .online-slot #onlinePanel{
  opacity:1!important;
  visibility:visible!important;
  background:#0b1627!important;
  background-color:#0b1627!important;
  color:#f8fafc!important;
  border:1px solid #294563!important;
  box-shadow:0 18px 50px rgba(0,0,0,.72)!important;
  backdrop-filter:none!important;
  -webkit-backdrop-filter:none!important;
  pointer-events:auto!important;
}
.chat-page .chatbox > .online-slot #onlinePanel[hidden]{display:none!important;}
@media(max-width:700px){
  .chat-page .chatbox > .online-slot{
    justify-content:flex-end!important;
    padding-left:6px!important;
    padding-right:8px!important;
  }
  .chat-page .chatbox > .online-slot .online-widget,
  .chat-page .chatbox > .online-slot #onlineCount{
    margin-left:auto!important;
    margin-right:0!important;
  }
}
\n\n/* v211 — desktop online button click fix only. Keep the indicator in its existing slot. */\n.chat-page .chatbox > .online-slot{\n  position:relative!important;\n  z-index:2147483000!important;\n  isolation:isolate!important;\n  overflow:visible!important;\n  pointer-events:auto!important;\n}\n.chat-page .chatbox > .online-slot .online-widget{\n  position:relative!important;\n  z-index:2147483001!important;\n  pointer-events:auto!important;\n  isolation:isolate!important;\n}\n.chat-page .chatbox > .online-slot #onlineCount{\n  position:relative!important;\n  z-index:2147483002!important;\n  pointer-events:auto!important;\n  cursor:pointer!important;\n  user-select:none!important;\n  -webkit-user-select:none!important;\n  touch-action:manipulation!important;\n}\n.chat-page .chatbox > .online-slot #onlinePanel{\n  z-index:2147483003!important;\n  pointer-events:auto!important;\n  opacity:1!important;\n  visibility:visible!important;\n  background:#0b1627!important;\n  background-color:#0b1627!important;\n  backdrop-filter:none!important;\n  -webkit-backdrop-filter:none!important;\n}\n@media(min-width:701px){\n  .chat-page .chatbox > .online-slot{\n    min-height:42px!important;\n  }\n}\n

/* v213 — online list only: render the dropdown outside the chat overflow surface. */
body.chat-page > #onlinePanel{
  position:fixed!important;
  z-index:2147483647!important;
  box-sizing:border-box!important;
  width:min(360px,calc(100vw - 20px))!important;
  max-height:min(420px,60vh)!important;
  overflow:auto!important;
  margin:0!important;
  opacity:1!important;
  visibility:visible!important;
  background:#0b1627!important;
  background-color:#0b1627!important;
  color:#f8fafc!important;
  border:1px solid #294563!important;
  border-radius:18px!important;
  box-shadow:0 18px 50px rgba(0,0,0,.72)!important;
  backdrop-filter:none!important;
  -webkit-backdrop-filter:none!important;
  pointer-events:auto!important;
}
body.chat-page > #onlinePanel[hidden]{display:none!important;}
body.chat-page > #onlinePanel .online-panel-head{
  display:flex!important;align-items:center!important;justify-content:space-between!important;
  gap:10px!important;padding:10px 11px!important;color:#f8fafc!important;
  background:#0b1627!important;border-bottom:1px solid #294563!important;
}
body.chat-page > #onlinePanel .online-users{display:grid!important;gap:4px!important;padding:6px!important;}
body.chat-page > #onlinePanel .online-users>a{
  display:flex!important;align-items:center!important;gap:9px!important;width:100%!important;
  box-sizing:border-box!important;padding:8px!important;border-radius:10px!important;
  color:#f8fafc!important;background:#101d30!important;text-decoration:none!important;
}
body.chat-page > #onlinePanel .online-users>a:hover{background:#172a43!important;}
body.chat-page > #onlinePanel .online-user-name,
body.chat-page > #onlinePanel .online-user-name b{color:#f8fafc!important;min-width:0!important;background:transparent!important;}
@media(max-width:700px){
  body.chat-page > #onlinePanel{width:min(320px,calc(100vw - 20px))!important;max-height:min(360px,60vh)!important;}
}

/* ===== v225 chat visual refresh: keep existing action positions, remove square chrome ===== */
.chat-page #messages{scroll-behavior:smooth;padding:12px 14px 18px;}
.chat-page .message{margin:0 0 12px;display:flex;animation:chatIn225 .18s ease-out both;}
.chat-page .message.me{justify-content:flex-end;}
.chat-page .chat-bubble{position:relative;max-width:min(78%,720px);padding:10px 13px 9px;border:1px solid color-mix(in srgb,var(--line) 78%,transparent);border-radius:18px;background:var(--card);box-shadow:0 7px 22px rgba(15,23,42,.08);transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease;}
.chat-page .message.me .chat-bubble{background:linear-gradient(135deg,rgba(37,99,235,.16),rgba(14,165,233,.10));border-color:rgba(37,99,235,.28);}
.chat-page .chat-bubble:hover{transform:translateY(-1px);box-shadow:0 10px 28px rgba(15,23,42,.12);}
.chat-page .chat-userline,.chat-page .msg-head{display:flex;align-items:center;gap:8px;margin-bottom:5px;min-height:28px;}
.chat-page .chat-userline>span,.chat-page .msg-head>span{display:flex;align-items:baseline;gap:7px;min-width:0;flex-wrap:wrap;}
.chat-page .chat-userline b,.chat-page .msg-head b{font-weight:800;}
.chat-page .chat-userline small,.chat-page .msg-head small{font-size:11px;color:var(--muted);white-space:nowrap;}
.chat-page .chat-bubble p{margin:3px 0 2px;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.48;font-size:15px;}
.chat-page .chat-photo{display:block;max-width:min(100%,520px);max-height:430px;border-radius:14px;margin-top:8px;object-fit:cover;}
.chat-page .reactions{display:flex;flex-wrap:wrap;gap:3px;margin:5px 0 0;min-height:0;}
.chat-page .reactions .reaction,.chat-page .msg-hover-tools button,.chat-page .msg-hover-tools .reaction{background:transparent!important;border:0!important;box-shadow:none!important;outline:0!important;border-radius:7px!important;color:inherit!important;padding:4px 5px!important;min-width:auto!important;height:28px!important;font-size:15px!important;line-height:1!important;}
.chat-page .reactions .reaction:hover,.chat-page .msg-hover-tools button:hover,.chat-page .msg-hover-tools .reaction:hover{background:rgba(127,127,127,.10)!important;transform:none!important;}
.chat-page .reactions .reaction.active{background:rgba(37,99,235,.10)!important;}
.chat-page .msg-hover-tools{display:flex;align-items:center;gap:2px;flex-wrap:wrap;margin-top:5px;padding:0;background:transparent;border:0;box-shadow:none;}
.chat-page .msg-hover-tools .quick-reactions{display:flex;align-items:center;gap:1px;background:transparent!important;border:0!important;box-shadow:none!important;padding:0!important;}
.chat-page .msg-hover-tools .tool-divider{display:none;}
.chat-page .msg-hover-tools .reply-btn{font-size:13px!important;}
.chat-page .message:not(.tools-open) .msg-hover-tools{opacity:.72;}
.chat-page .message:not(.tools-open) .msg-hover-tools:hover{opacity:1;}
.chat-page .quick-reactions{background:transparent!important;}
.chat-page .chat-poll{margin-top:9px;padding:13px;border:1px solid var(--line);border-radius:15px;background:var(--card2);}
.chat-page .chat-poll-title{font-weight:850;font-size:15px;line-height:1.35;}
.chat-page .chat-poll-meta{font-size:11px;color:var(--muted);margin:4px 0 9px;}
.chat-page .poll-list{display:grid;gap:6px;}
.chat-page .poll-option{width:100%;text-align:left;border:1px solid var(--line);background:transparent;color:inherit;border-radius:11px;padding:8px 9px;cursor:pointer;}
.chat-page .poll-option.voted{border-color:var(--brand);background:rgba(37,99,235,.07);}
.chat-page .poll-option:disabled{cursor:default;opacity:.9;}
.chat-page .poll-option-top{display:flex;justify-content:space-between;gap:8px;align-items:center;}
.chat-page .poll-option-top small{color:var(--muted);font-size:11px;white-space:nowrap;}
.chat-page .poll-bar{display:block;height:4px;margin-top:6px;border-radius:999px;background:rgba(127,127,127,.13);overflow:hidden;}
.chat-page .poll-bar i{display:block;height:100%;border-radius:inherit;background:var(--brand);}
.chat-page .poll-close-inline{margin-top:8px;border:0;background:transparent;color:var(--muted);font-size:11px;padding:3px;cursor:pointer;}
.chat-page .poll-modal{position:fixed;inset:0;z-index:10050;display:grid;place-items:center;padding:16px;background:rgba(2,6,23,.68);backdrop-filter:blur(6px);}
.chat-page .poll-modal[hidden]{display:none;}
.chat-page .poll-card{width:min(520px,100%);padding:20px;border-radius:22px;background:var(--card);color:var(--text);border:1px solid var(--line);box-shadow:0 25px 70px rgba(0,0,0,.35);}
.chat-page .poll-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;margin-bottom:14px;}
.chat-page .poll-head h3{margin:2px 0 0;}
.chat-page .poll-close{border:0;background:transparent;color:inherit;font-size:20px;cursor:pointer;padding:3px 6px;}
.chat-page .poll-card>input{width:100%;box-sizing:border-box;background:var(--card2);color:inherit;border:1px solid var(--line);border-radius:12px;padding:12px;margin-bottom:9px;}
.chat-page .poll-options{display:grid;gap:8px;}
.chat-page .poll-options input{width:100%;box-sizing:border-box;background:var(--card2);color:inherit;border:1px solid var(--line);border-radius:12px;padding:10px 12px;}
.chat-page .poll-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:12px;}
.chat-page .poll-actions label{font-size:12px;color:var(--muted);display:flex;align-items:center;gap:5px;flex:1 1 180px;}
.chat-page .poll-status{margin-top:8px;color:var(--muted);font-size:12px;}
.chat-page .chat-poll-open{display:inline-flex;align-items:center;justify-content:center;min-height:38px;border:1px solid var(--line);background:var(--card2);color:var(--text);border-radius:11px;padding:0 12px;font-weight:750;cursor:pointer;}
@keyframes chatIn225{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}
@media(max-width:700px){.chat-page .chat-bubble{max-width:88%;border-radius:16px;padding:9px 11px}.chat-page #messages{padding:9px 8px 14px}.chat-page .chat-bubble p{font-size:14px}.chat-page .chat-photo{max-height:330px}.chat-page .msg-hover-tools{gap:1px}.chat-page .msg-hover-tools button{padding:4px!important}.chat-page .poll-card{padding:16px;border-radius:18px}}
@media(prefers-reduced-motion:reduce){.chat-page .message,.chat-page .chat-bubble{animation:none;transition:none}}


/* v226 — attachment menu: poll is created from the paperclip, not above the chat */
.chat-page .composer-attach-wrap{position:relative;display:flex;align-items:flex-end;flex:0 0 auto;}
.chat-page .composer-attach-wrap .composer-photo-btn{position:relative;z-index:3;}
.chat-page .attach-menu{position:absolute;right:0;bottom:calc(100% + 9px);z-index:10040;display:none;grid-template-columns:1fr;gap:4px;min-width:174px;padding:7px;border:1px solid var(--line);border-radius:14px;background:var(--card);box-shadow:0 16px 38px rgba(0,0,0,.28);}
.chat-page .attach-menu::after{content:"";position:absolute;right:15px;bottom:-6px;width:10px;height:10px;background:var(--card);border-right:1px solid var(--line);border-bottom:1px solid var(--line);transform:rotate(45deg);}
.chat-page .attach-menu-item{display:flex;align-items:center;gap:9px;width:100%;min-height:40px;padding:8px 10px;border:0;border-radius:10px;background:transparent;color:var(--text);font-weight:750;text-align:left;cursor:pointer;}
.chat-page .attach-menu-item:hover,.chat-page .attach-menu-item:focus-visible{background:var(--card2);outline:none;}
@media (hover:hover) and (pointer:fine){
 .chat-page .composer-attach-wrap:hover .attach-menu{display:grid;}
}
.chat-page .composer-attach-wrap .attach-menu[data-open="1"]{display:grid;}
.chat-page .poll-check{display:inline-flex!important;align-items:center!important;gap:8px!important;cursor:pointer!important;user-select:none;}
.chat-page .poll-check input{position:absolute!important;opacity:0!important;width:1px!important;height:1px!important;pointer-events:none!important;}
.chat-page .poll-checkmark{width:20px;height:20px;flex:0 0 20px;border:1.5px solid var(--muted);border-radius:6px;background:var(--card2);display:grid;place-items:center;transition:background .16s ease,border-color .16s ease,transform .16s ease;}
.chat-page .poll-checkmark::after{content:"";width:9px;height:5px;border-left:2px solid #fff;border-bottom:2px solid #fff;transform:rotate(-45deg) scale(0);transition:transform .14s ease;}
.chat-page .poll-check input:checked + .poll-checkmark{background:var(--brand);border-color:var(--brand);}
.chat-page .poll-check input:checked + .poll-checkmark::after{transform:rotate(-45deg) scale(1);}
.chat-page .poll-check input:focus-visible + .poll-checkmark{outline:2px solid var(--brand);outline-offset:2px;}
@media(max-width:700px){
 .chat-page .attach-menu{right:-3px;min-width:160px;bottom:calc(100% + 8px);}
 .chat-page .attach-menu-item{min-height:42px;}
}

/* ===== v227 chat visual cleanup ===== */
/* Remove visible button frames around chat reactions/tools without moving them. */
.chat-page .msg-hover-tools button,
.chat-page .msg-hover-tools .reaction,
.chat-page .msg-hover-tools .reply-btn,
.chat-page .quick-reactions .reaction,
.chat-page .v27-composer-row .v27-emoji-btn,
.chat-page .v27-composer-row .composer-photo-btn,
.chat-page .v27-composer-row .v27-send,
.chat-page .v27-composer-row .chat-tool-btn{
  border:0!important;
  outline:0!important;
  box-shadow:none!important;
  background:transparent!important;
  -webkit-appearance:none!important;
  appearance:none!important;
}
.chat-page .msg-hover-tools button:hover,
.chat-page .msg-hover-tools .reaction:hover,
.chat-page .msg-hover-tools .reaction.active,
.chat-page .v27-composer-row .v27-emoji-btn:hover,
.chat-page .v27-composer-row .composer-photo-btn:hover,
.chat-page .v27-composer-row .v27-send:hover{
  background:rgba(96,165,250,.10)!important;
  transform:none!important;
  box-shadow:none!important;
}
.chat-page .msg-hover-tools button:focus-visible,
.chat-page .msg-hover-tools .reaction:focus-visible,
.chat-page .v27-composer-row button:focus-visible{
  outline:2px solid rgba(96,165,250,.55)!important;
  outline-offset:2px;
}
/* Keep the existing positions/order, but make the controls visually light and modern. */
.chat-page .v27-composer-row .v27-emoji-btn,
.chat-page .v27-composer-row .composer-photo-btn,
.chat-page .v27-composer-row .v27-send{
  border-radius:10px!important;
  color:var(--text)!important;
  transition:background .16s ease,transform .16s ease,color .16s ease;
}
.chat-page .v27-composer-row .v27-send{color:var(--brand)!important;font-size:20px!important}
.chat-page .v27-composer-row .composer-photo-btn{color:var(--muted)!important}
.chat-page .v27-composer-row .v27-emoji-btn{font-size:19px!important}
/* Modern message cards/bubbles; no layout changes. */
.chat-page .message{margin-bottom:12px!important;animation:chatMsgIn .18s ease both}
.chat-page .message .chat-bubble{
  border:1px solid rgba(148,163,184,.16)!important;
  border-radius:18px!important;
  padding:10px 12px!important;
  background:rgba(255,255,255,.96)!important;
  box-shadow:0 5px 18px rgba(15,23,42,.07)!important;
  transition:box-shadow .16s ease,transform .16s ease,border-color .16s ease;
}
.chat-page .message:hover .chat-bubble{box-shadow:0 8px 24px rgba(15,23,42,.10)!important}
.chat-page .message.me .chat-bubble,
.chat-page .message.mine .chat-bubble{
  background:linear-gradient(135deg,var(--brand),var(--brand2))!important;
  color:#fff!important;
  border-color:transparent!important;
  box-shadow:0 7px 22px rgba(37,99,235,.18)!important;
}
.chat-page .chat-userline,.chat-page .msg-head{gap:8px!important}
.chat-page .chat-userline small,.chat-page .msg-head small{color:var(--muted)!important;font-size:10px!important}
.chat-page .message.me .chat-userline small,.chat-page .message.mine .chat-userline small{color:rgba(255,255,255,.72)!important}
.chat-page .chat-bubble p{font-size:15px!important;line-height:1.48!important;letter-spacing:.005em}
.chat-page .chat-photo{border-radius:14px!important;box-shadow:0 5px 18px rgba(0,0,0,.12)!important}
.chat-page .reactions{background:transparent!important;border:0!important;box-shadow:none!important;padding:0!important}
@keyframes chatMsgIn{from{opacity:.35;transform:translateY(3px)}to{opacity:1;transform:none}}
/* Emoji panel: keep position/size, replace browser-white scrollbar with a themed one. */
.chat-page .v27-emoji-panel{
  scrollbar-width:thin!important;
  scrollbar-color:rgba(96,165,250,.75) transparent!important;
  overscroll-behavior:contain!important;
}
.chat-page .v27-emoji-panel::-webkit-scrollbar{width:8px;height:8px!important}
.chat-page .v27-emoji-panel::-webkit-scrollbar-track{background:transparent!important;border-radius:999px!important}
.chat-page .v27-emoji-panel::-webkit-scrollbar-thumb{
  background:linear-gradient(180deg,#38bdf8,#2563eb)!important;
  border-radius:999px!important;
  border:2px solid transparent!important;
  background-clip:padding-box!important;
}
.chat-page .v27-emoji-panel::-webkit-scrollbar-thumb:hover{background:linear-gradient(180deg,#67e8f9,#3b82f6)!important;background-clip:padding-box!important}
.chat-page .v27-emoji-panel::-webkit-scrollbar-corner{background:transparent!important}
/* Emoji tiles themselves stay in exactly the same grid positions. */
.chat-page .v27-emoji-panel .emoji-item,
.chat-page .v27-emoji-panel .v27-emoji{
  border:0!important;
  box-shadow:none!important;
  background:transparent!important;
  border-radius:10px!important;
}
.chat-page .v27-emoji-panel .emoji-item:hover,
.chat-page .v27-emoji-panel .v27-emoji:hover{background:rgba(96,165,250,.12)!important}
body.dark .chat-page .message .chat-bubble{background:#101b2d!important;border-color:rgba(96,165,250,.16)!important;color:#e5eefb!important;box-shadow:0 8px 24px rgba(0,0,0,.20)!important}
body.dark .chat-page .message.me .chat-bubble,
body.dark .chat-page .message.mine .chat-bubble{background:linear-gradient(135deg,#2563eb,#0891b2)!important;color:#fff!important;border-color:transparent!important}
body.dark .chat-page .v27-composer-row .v27-emoji-btn,
body.dark .chat-page .v27-composer-row .composer-photo-btn{color:#cbd5e1!important}
body.dark .chat-page .v27-composer-row .v27-send{color:#67e8f9!important}
@media(max-width:900px){
 .chat-page .message{margin-bottom:9px!important}
 .chat-page .message .chat-bubble{padding:9px 10px!important;border-radius:16px!important}
 .chat-page .chat-bubble p{font-size:14px!important;line-height:1.42!important}
}
@media(prefers-reduced-motion:reduce){.chat-page .message{animation:none!important}.chat-page .message .chat-bubble,.chat-page .v27-composer-row button{transition:none!important}}


/* ===== v228 — restore chat message readability + truly frameless controls ===== */
.chat-page #messages .message .chat-bubble{
  color:var(--text,#e7eef8)!important;
  background:var(--card,#0f172a)!important;
  border:1px solid rgba(148,163,184,.14)!important;
  box-shadow:0 8px 24px rgba(0,0,0,.16)!important;
}
.chat-page #messages .message .chat-bubble p,
.chat-page #messages .message .chat-bubble .chat-userline b,
.chat-page #messages .message .chat-bubble .msg-head b{
  color:inherit!important;
}
.chat-page #messages .message .chat-bubble .chat-userline small,
.chat-page #messages .message .chat-bubble .msg-head small{
  color:var(--muted,#94a3b8)!important;
}
.chat-page #messages .message.me .chat-bubble,
.chat-page #messages .message.mine .chat-bubble{
  color:#fff!important;
  background:linear-gradient(135deg,#2563eb,#0891b2)!important;
  border-color:transparent!important;
  box-shadow:0 8px 24px rgba(37,99,235,.18)!important;
}
.chat-page #messages .message.me .chat-bubble .chat-userline small,
.chat-page #messages .message.mine .chat-bubble .chat-userline small,
.chat-page #messages .message.me .chat-bubble .msg-head small,
.chat-page #messages .message.mine .chat-bubble .msg-head small{color:rgba(255,255,255,.72)!important}

/* Light theme: keep messages readable without bringing back heavy frames. */
html:not([data-site-theme="dark"]) .chat-page #messages .message .chat-bubble{
  color:#172033!important;
  background:#f8fbff!important;
  border-color:rgba(100,116,139,.12)!important;
  box-shadow:0 6px 20px rgba(15,23,42,.06)!important;
}
html:not([data-site-theme="dark"]) .chat-page #messages .message.me .chat-bubble,
html:not([data-site-theme="dark"]) .chat-page #messages .message.mine .chat-bubble{
  color:#fff!important;
  background:linear-gradient(135deg,#2563eb,#0891b2)!important;
  border-color:transparent!important;
}

/* Dark theme variants used by the site theme selector. */
html[data-site-theme="dark"] .chat-page #messages .message .chat-bubble,
body.dark.chat-page #messages .message .chat-bubble,
body.site-theme-dark.chat-page #messages .message .chat-bubble{
  color:#e8f3ff!important;
  background:#0d1a2c!important;
  border-color:rgba(96,165,250,.14)!important;
  box-shadow:0 8px 26px rgba(0,0,0,.24)!important;
}
html[data-site-theme="dark"] .chat-page #messages .message.me .chat-bubble,
body.dark.chat-page #messages .message.me .chat-bubble,
body.site-theme-dark.chat-page #messages .message.me .chat-bubble,
html[data-site-theme="dark"] .chat-page #messages .message.mine .chat-bubble,
body.dark.chat-page #messages .message.mine .chat-bubble,
body.site-theme-dark.chat-page #messages .message.mine .chat-bubble{
  color:#fff!important;
  background:linear-gradient(135deg,#2563eb,#0891b2)!important;
  border-color:transparent!important;
}

/* Truly frameless reaction/action controls. Their order and position are unchanged. */
.chat-page #messages .msg-hover-tools,
.chat-page #messages .quick-reactions{
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
  padding:0!important;
}
.chat-page #messages .msg-hover-tools .reaction,
.chat-page #messages .msg-hover-tools .reply-btn,
.chat-page #messages .msg-hover-tools button,
.chat-page #messages .quick-reactions .reaction{
  background:transparent!important;
  border:0!important;
  outline:0!important;
  box-shadow:none!important;
  color:inherit!important;
  border-radius:8px!important;
  min-width:32px!important;
  height:32px!important;
  padding:3px 6px!important;
}
.chat-page #messages .msg-hover-tools .reaction:hover,
.chat-page #messages .msg-hover-tools .reply-btn:hover,
.chat-page #messages .msg-hover-tools button:hover,
.chat-page #messages .quick-reactions .reaction:hover,
.chat-page #messages .quick-reactions .reaction.active{
  background:rgba(96,165,250,.12)!important;
  border:0!important;
  box-shadow:none!important;
  transform:none!important;
}
.chat-page #messages .msg-hover-tools .tool-divider{display:none!important}

/* No white browser scrollbar in the emoji picker. */
.chat-page .v27-emoji-panel{
  scrollbar-width:thin!important;
  scrollbar-color:#38bdf8 transparent!important;
}
.chat-page .v27-emoji-panel::-webkit-scrollbar{width:7px!important;height:7px!important}
.chat-page .v27-emoji-panel::-webkit-scrollbar-track{background:transparent!important}
.chat-page .v27-emoji-panel::-webkit-scrollbar-thumb{background:#38bdf8!important;border-radius:999px!important;border:1px solid rgba(15,23,42,.35)!important}
.chat-page .v27-emoji-panel::-webkit-scrollbar-thumb:hover{background:#67e8f9!important}
.chat-page .v27-emoji-panel::-webkit-scrollbar-corner{background:transparent!important}

/* Emoji cells are clean, but remain in their existing grid positions. */
.chat-page .v27-emoji-panel .emoji-item,
.chat-page .v27-emoji-panel .v27-emoji{
  border:0!important;
  outline:0!important;
  box-shadow:none!important;
  background:transparent!important;
  border-radius:10px!important;
}
.chat-page .v27-emoji-panel .emoji-item:hover,
.chat-page .v27-emoji-panel .v27-emoji:hover{background:rgba(56,189,248,.12)!important}


/* v229 targeted fixes: admin dashboard, admin-name color, and search scrollbar. */
.admin-page .admin-stats.pro-stats{
  grid-template-columns:repeat(5,minmax(0,1fr))!important;
  gap:8px!important;
  width:100%!important;
}
.admin-page .admin-stats.pro-stats>div{
  min-width:0!important;
  width:auto!important;
  box-sizing:border-box!important;
}
.admin-page .admin-stats.pro-stats span{
  white-space:normal!important;
  overflow-wrap:anywhere!important;
  word-break:break-word!important;
}
.chat-page #messages .chat-userline .admin-name,
.chat-page #messages .msg-head .admin-name,
.chat-page #messages .message.me .chat-userline .admin-name,
.chat-page #messages .message.me .msg-head .admin-name{
  color:var(--admin-text-color,#2563eb)!important;
}
.chat-page .users-list,
.chat-page #messages,
.chat-page .emoji-panel,
.chat-page .v27-emoji-panel{
  scrollbar-width:thin;
  scrollbar-color:rgba(56,189,248,.72) rgba(15,23,42,.55);
}
.chat-page .users-list::-webkit-scrollbar,
.chat-page #messages::-webkit-scrollbar,
.chat-page .emoji-panel::-webkit-scrollbar,
.chat-page .v27-emoji-panel::-webkit-scrollbar{width:8px;height:8px}
.chat-page .users-list::-webkit-scrollbar-track,
.chat-page #messages::-webkit-scrollbar-track,
.chat-page .emoji-panel::-webkit-scrollbar-track,
.chat-page .v27-emoji-panel::-webkit-scrollbar-track{background:rgba(15,23,42,.55);border-radius:999px}
.chat-page .users-list::-webkit-scrollbar-thumb,
.chat-page #messages::-webkit-scrollbar-thumb,
.chat-page .emoji-panel::-webkit-scrollbar-thumb,
.chat-page .v27-emoji-panel::-webkit-scrollbar-thumb{background:linear-gradient(180deg,#38bdf8,#2563eb);border-radius:999px;border:2px solid rgba(15,23,42,.55)}
.chat-page .users-list::-webkit-scrollbar-thumb:hover,
.chat-page #messages::-webkit-scrollbar-thumb:hover,
.chat-page .emoji-panel::-webkit-scrollbar-thumb:hover{background:linear-gradient(180deg,#67e8f9,#3b82f6)}
@media(max-width:1050px){.admin-page .admin-stats.pro-stats{grid-template-columns:repeat(3,minmax(0,1fr))!important}}
@media(max-width:700px){.admin-page .admin-stats.pro-stats{grid-template-columns:repeat(2,minmax(0,1fr))!important}}
.profile-modern .profile-section-nav~#privacyPanel.profile-section-active{display:block!important}

/* v231 — personal mobile layout + online control */
@media(max-width:700px){
  html,body{max-width:100%;overflow-x:hidden!important}
  body{padding-bottom:68px!important}
  header{width:100%!important;box-sizing:border-box!important}
  main,.container,.page-wrap,.page-shell,.content,.detail-wrap{width:100%!important;max-width:100%!important;box-sizing:border-box!important}
  main{padding-left:10px!important;padding-right:10px!important}
  img,video,iframe{max-width:100%!important}
  input,select,textarea,button{max-width:100%;box-sizing:border-box}
  .grid,.cards,.market-grid,.news-list{min-width:0!important}
  .card,.panel,.profile-panel,.market-card,.news-card{min-width:0!important;box-sizing:border-box}
  .page-head{gap:10px!important;align-items:flex-start!important}
  .page-head h1{font-size:24px!important;line-height:1.15!important}
  .topnav a{white-space:nowrap!important}
  .mobile-nav{left:0!important;right:0!important;bottom:0!important;width:100%!important;box-sizing:border-box!important}
  .mobile-nav a{min-width:0!important;overflow:hidden!important}
  table{display:block!important;width:100%!important;overflow-x:auto!important}
  .form-row,.form-grid,.edit-grid{grid-template-columns:1fr!important}
}

/* Mobile online button: right side, compact and easy to tap. The list opens fixed to it. */
@media(max-width:700px){
  .chat-page .online-slot{display:flex!important;justify-content:flex-end!important;width:100%!important;margin:0!important;padding:0 6px 5px!important;box-sizing:border-box!important}
  .chat-page .badges.online-widget{display:flex!important;justify-content:flex-end!important;width:auto!important;margin-left:auto!important}
  .chat-page #onlineCount{min-width:0!important;width:auto!important;max-width:145px!important;height:34px!important;min-height:34px!important;padding:5px 10px!important;font-size:12px!important;border-radius:999px!important}
  #onlinePanel{max-width:calc(100vw - 20px)!important;max-height:60vh!important;overflow:auto!important;border-radius:16px!important}
}

/* Never display an empty notification count. */
.global-notify-badge:empty,.mobile-notify-count:empty,.ann-new-badge:empty,.forum-new-badge:empty,.market-new-badge:empty{display:none!important}

/* v233 mobile performance pass: no feature changes. */
@media (max-width:700px){
  /* Expensive blur/backdrop effects are the biggest avoidable cost on mobile. */
  header,.mobile-nav,.market-tools,body.site-theme-glass .card,body.site-theme-glass .chatbox,body.site-theme-glass .users-panel,body.site-theme-glass .forum-card,body.site-theme-glass .topic-list,body.site-theme-glass .profile-card,body.site-theme-glass .profile-panel{
    -webkit-backdrop-filter:none!important;
    backdrop-filter:none!important;
  }
  /* Keep the UI responsive on lower-end phones. */
  .chatbox,.profile-card,.forum-card,.topic-list,.market-card,.news-card,.notification-item,.smart-notify-toast{animation:none!important;}
  .user-online-dot.is-online{animation:none!important;}
  img{content-visibility:auto;}
  .profile-shell,.sn-wrap,.forum-page,.market-page,.page-wrap{contain:layout paint;}
}

/* v234 targeted mobile nav stabilization: fixed icon/label sizing, no emoji reflow. */
@media (max-width:700px){
  .mobile-nav{display:flex!important;align-items:stretch!important;box-sizing:border-box!important;}
  .mobile-nav a{
    flex:1 1 0!important;min-width:0!important;width:0!important;height:100%!important;
    display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;
    gap:2px!important;padding:3px 1px!important;box-sizing:border-box!important;
    font-size:11px!important;line-height:1!important;transform:none!important;
  }
  .mobile-nav a .nav-icon{
    display:flex!important;align-items:center!important;justify-content:center!important;
    width:28px!important;height:28px!important;min-width:28px!important;min-height:28px!important;
    font-size:22px!important;line-height:28px!important;overflow:visible!important;
  }
  .mobile-nav a span:not(.nav-icon){
    display:block!important;width:100%!important;max-width:100%!important;height:12px!important;
    margin:0!important;font-size:9px!important;line-height:12px!important;font-weight:800!important;
    white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;
  }
  .mobile-nav a.active{transform:none!important;}
}

/* v235 — mobile chat composer: attachment button follows the text field. */
@media (max-width:700px){
  .chat-page .v27-composer-row #text{order:1!important;}
  .chat-page .v27-composer-row #voiceBtn{order:2!important;}
  .chat-page .v27-composer-row .composer-photo-btn{order:3!important;}
  .chat-page .v27-composer-row .v27-emoji-btn{order:4!important;}
  .chat-page .v27-composer-row .v27-send{order:5!important;}
}


/* v236 — notification counters: never show a zero; keep the badge neatly inside the bell. */
.mobile-nav .mobile-section-count:not(.is-visible){display:none!important;}
.mobile-nav .mobile-notify-count:empty{display:none!important;}
.mobile-nav a[href="notifications.php"] .mobile-notify-count{top:1px!important;right:calc(50% - 24px)!important;transform:none!important;min-width:18px!important;height:18px!important;padding:0 5px!important;border-radius:999px!important;line-height:14px!important;box-sizing:border-box!important;z-index:5!important;}
.mobile-nav a[href="notifications.php"] .mobile-notify-count:not(:empty){display:inline-flex!important;}
.topnav a[href="notifications.php"] .global-notify-badge:empty{display:none!important;}


/* v237 — mobile profile + notifications final responsive pass */
.profile-modern .profile-stats{
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  overflow:hidden!important;
}
.profile-modern .profile-stats .stat-link{
  min-width:0!important;
  width:100%!important;
  max-width:100%!important;
  box-sizing:border-box!important;
  overflow:hidden!important;
  display:flex!important;
  flex-direction:column!important;
  justify-content:center!important;
}
.profile-modern .profile-stats .stat-link b,
.profile-modern .profile-stats .stat-link span{
  min-width:0!important;
  max-width:100%!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
}
.profile-modern .profile-content,
.profile-modern .profile-panel,
.profile-modern .profile-head,
.profile-modern .profile-head-actions,
.profile-modern .profile-title,
.profile-modern .edit-fields{min-width:0!important;max-width:100%!important;}
.profile-modern .profile-head-actions .profile-btn{min-width:0!important;max-width:100%!important;overflow:hidden;text-overflow:ellipsis;}

/* Notification center: stable cards and action rows on narrow screens. */
.notification-settings,.notification-settings-grid,#requests,#list{min-width:0!important;max-width:100%!important;box-sizing:border-box!important;}
.notification-settings-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;}
.notification-setting{min-width:0;display:flex;align-items:center;gap:10px;padding:12px;border:1px solid var(--line);border-radius:14px;background:var(--card2);box-sizing:border-box;}
.notification-setting span{min-width:0;overflow:hidden;}
.notification-setting b,.notification-setting small{display:block;overflow-wrap:anywhere;word-break:break-word;}
.notification-setting small{color:var(--muted);margin-top:3px;font-size:11px;}
.notification-setting input{flex:0 0 auto;width:20px;height:20px;accent-color:var(--brand,#2563eb);}
.notification-item{min-width:0;box-sizing:border-box;overflow:hidden;}
.notification-link>div:last-child{min-width:0;overflow:hidden;}
.notification-link b,.notification-link p,.notification-link small{overflow-wrap:anywhere;word-break:break-word;}
.notification-actions{min-width:0;}
@media(max-width:800px){
  .profile-modern .profile-stats{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important;}
  .profile-modern .profile-stats .stat-link{min-height:68px!important;padding:10px 8px!important;}
  .profile-modern .profile-stats .stat-link b{font-size:20px!important;line-height:1.05!important;}
  .profile-modern .profile-stats .stat-link span{font-size:11px!important;}
  .notification-settings-grid{grid-template-columns:1fr!important;}
}
@media(max-width:430px){
  .profile-modern .profile-stats{gap:7px!important;}
  .profile-modern .profile-stats .stat-link{min-height:64px!important;padding:9px 7px!important;border-radius:13px!important;}
  .profile-modern .profile-stats .stat-link b{font-size:18px!important;}
  .profile-modern .profile-stats .stat-link span{font-size:10px!important;}
}


/* v238 — mobile chat composer + reliable scroll after sending. */
@media (max-width:700px){
  .chat-page .v27-composer-row{
    display:flex!important;
    align-items:center!important;
    gap:4px!important;
    padding:4px!important;
    min-height:46px!important;
    max-height:96px!important;
    box-sizing:border-box!important;
  }
  .chat-page .v27-composer-row #text{
    order:1!important;
    flex:1 1 auto!important;
    min-width:0!important;
    width:auto!important;
    height:40px!important;
    min-height:40px!important;
    max-height:80px!important;
    padding:8px 9px!important;
    line-height:22px!important;
    box-sizing:border-box!important;
    overflow-y:auto!important;
  }
  .chat-page .v27-composer-row #voiceBtn{order:2!important;}
  .chat-page .v27-composer-row .composer-attach-wrap{
    order:3!important;
    flex:0 0 38px!important;
    width:38px!important;
    min-width:38px!important;
    height:38px!important;
    position:relative!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
  }
  .chat-page .v27-composer-row .composer-photo-btn{
    order:initial!important;
    flex:0 0 38px!important;
    width:38px!important;
    min-width:38px!important;
    height:38px!important;
    margin:0!important;
  }
  .chat-page .v27-composer-row .v27-emoji-btn{
    order:4!important;
    flex:0 0 38px!important;
    width:38px!important;
    min-width:38px!important;
    height:38px!important;
  }
  .chat-page .v27-composer-row .v27-send{
    order:5!important;
    flex:0 0 38px!important;
    width:38px!important;
    min-width:38px!important;
    height:38px!important;
  }
  .chat-page .composer-attach-wrap .attach-menu{
    left:50%!important;
    right:auto!important;
    bottom:44px!important;
    transform:translateX(-50%)!important;
  }
}
.chat-page #messages.is-scrolling-bottom{scroll-behavior:auto!important;}
/* v239 — modern app shell + single chat scrollbar + compact composer */
html{scroll-behavior:auto}

/* Modern shared visual language: less 2000s, more app-like. */
body{background:radial-gradient(circle at 10% -10%,rgba(37,99,235,.16),transparent 34%),radial-gradient(circle at 100% 0,rgba(14,165,233,.12),transparent 30%),var(--bg)!important}
body:before{display:none!important}
header{padding:10px clamp(14px,3vw,34px)!important;background:rgba(7,14,27,.78)!important;border-bottom:1px solid rgba(148,163,184,.12)!important;box-shadow:0 10px 34px rgba(0,0,0,.16)!important}
.brand{font-size:22px!important;letter-spacing:-.035em!important;color:#f4f8ff!important}
.brand em{display:none!important}
.topnav{gap:3px!important;scrollbar-width:none!important}
.topnav::-webkit-scrollbar{display:none!important}
.topnav a,.theme-btn{border:0!important;background:transparent!important;color:#b9c8dc!important;border-radius:11px!important;font-size:13px!important;font-weight:700!important}
.topnav a:hover,.theme-btn:hover{background:rgba(59,130,246,.12)!important;color:#fff!important}
main{padding-top:14px!important}
.hero{padding:10px 2px 14px!important}
.hero h1{font-size:clamp(26px,4vw,38px)!important;letter-spacing:-.045em!important}
.hero p{font-size:13px!important;color:#8ea4bc!important}

.users-panel,.chatbox,.forum-card,.topic-list,.card,.profile-card,.admin-card,.rules-card{border:1px solid rgba(148,163,184,.12)!important;border-radius:22px!important;box-shadow:0 18px 55px rgba(0,0,0,.16)!important}

/* Chat becomes an app surface: the page itself does not compete with the message scroller. */
body.chat-page{overflow:hidden!important;height:100dvh!important;display:flex!important;flex-direction:column!important}
body.chat-page>main{height:auto!important;flex:1 1 auto!important;min-height:0!important;overflow:hidden!important;display:flex!important;flex-direction:column!important}
body.chat-page .chat-layout{flex:1 1 auto!important;min-height:0!important;height:auto!important}
body.chat-page .users-panel{min-height:0!important;height:100%!important;overflow:auto!important;scrollbar-width:thin!important;scrollbar-color:rgba(96,165,250,.35) transparent!important}
body.chat-page .chatbox{min-height:0!important;height:100%!important;overflow:hidden!important;background:rgba(8,18,32,.82)!important;border-color:rgba(96,165,250,.12)!important}
body.chat-page .chat-tools{background:rgba(8,18,32,.72)!important;border-bottom:1px solid rgba(148,163,184,.10)!important;padding:9px 12px!important}
body.chat-page .chat-search input{background:rgba(15,29,49,.78)!important;border:1px solid rgba(148,163,184,.18)!important;color:#e8f3ff!important;border-radius:14px!important}
body.chat-page #messages{
  flex:1 1 auto!important;min-height:0!important;height:auto!important;max-height:none!important;
  overflow-y:auto!important;overflow-x:hidden!important;scrollbar-gutter:auto!important;
  scrollbar-width:thin!important;scrollbar-color:rgba(56,189,248,.42) transparent!important;
  overscroll-behavior:contain!important;padding:16px 14px 12px!important;
}
body.chat-page #messages::-webkit-scrollbar{width:7px!important}
body.chat-page #messages::-webkit-scrollbar-track{background:transparent!important}
body.chat-page #messages::-webkit-scrollbar-thumb{background:linear-gradient(180deg,rgba(56,189,248,.42),rgba(37,99,235,.42))!important;border-radius:999px!important;border:2px solid transparent!important;background-clip:padding-box!important}
body.chat-page #messages::-webkit-scrollbar-thumb:hover{background:linear-gradient(180deg,rgba(56,189,248,.68),rgba(37,99,235,.68))!important;background-clip:padding-box!important}

/* Remove the old boxy/chatroom feel. */
body.chat-page #messages .message{margin:7px 0!important;padding:0 5px!important}
body.chat-page #messages .chat-bubble{border:0!important;box-shadow:0 8px 28px rgba(0,0,0,.16)!important;border-radius:18px!important;background:#122238!important;color:#e9f3ff!important;min-width:0!important}
body.chat-page #messages .message.me .chat-bubble{background:linear-gradient(135deg,#1677e8,#08a6c8)!important;color:#fff!important}
body.chat-page #messages .chat-userline b,body.chat-page #messages .msg-head b{font-size:13px!important}
body.chat-page #messages .chat-bubble p{font-size:15px!important;line-height:1.45!important}
body.chat-page #messages .message-meta{color:#91a6bd!important}
body.chat-page #messages .reactions .reaction{background:rgba(255,255,255,.07)!important;border:1px solid rgba(148,163,184,.12)!important;color:inherit!important;box-shadow:none!important}

/* Modern frameless action tray directly under a bubble. */
body.chat-page #messages .msg-hover-tools{border:1px solid rgba(148,163,184,.12)!important;background:rgba(12,25,43,.96)!important;box-shadow:0 14px 35px rgba(0,0,0,.28)!important;border-radius:14px!important;backdrop-filter:blur(14px)!important}
body.chat-page #messages .msg-hover-tools .reaction,body.chat-page #messages .msg-hover-tools .reply-btn{color:#e8f3ff!important}

/* Compact modern composer: textarea + attachment + emoji + send. */
body.chat-page .v27-composer{flex:0 0 auto!important;padding:9px 10px calc(9px + env(safe-area-inset-bottom))!important;background:rgba(7,16,29,.94)!important;border-top:1px solid rgba(148,163,184,.10)!important;box-shadow:0 -10px 28px rgba(0,0,0,.14)!important}
body.chat-page .v27-composer-row{display:flex!important;align-items:flex-end!important;gap:6px!important;width:100%!important;min-width:0!important}
body.chat-page .v27-composer-row #text{order:1!important;flex:1 1 auto!important;width:auto!important;min-width:0!important;height:42px!important;min-height:42px!important;max-height:88px!important;resize:none!important;padding:10px 12px!important;border-radius:14px!important;background:#101f34!important;border:1px solid rgba(148,163,184,.17)!important;color:#edf6ff!important;line-height:1.35!important;overflow-y:auto!important}
body.chat-page .v27-composer-row #voiceBtn{order:2!important;flex:0 0 42px!important;width:42px!important;height:42px!important;min-width:42px!important}
body.chat-page .v27-composer-row .composer-attach-wrap{order:2!important;flex:0 0 42px!important;width:42px!important;height:42px!important;display:flex!important;position:relative!important}
body.chat-page .v27-composer-row .composer-photo-btn{order:1!important;width:42px!important;height:42px!important;min-width:42px!important;border:0!important;border-radius:13px!important;background:#12243a!important;color:#bfe9ff!important}
body.chat-page .v27-composer-row .v27-emoji-btn{order:3!important;flex:0 0 42px!important;width:42px!important;height:42px!important;min-width:42px!important;border:0!important;border-radius:13px!important;background:#12243a!important}
body.chat-page .v27-composer-row .v27-send{order:4!important;flex:0 0 42px!important;width:42px!important;height:42px!important;min-width:42px!important;border:0!important;border-radius:13px!important;background:linear-gradient(135deg,#1477eb,#08a9c9)!important;color:#fff!important;box-shadow:0 8px 22px rgba(14,165,233,.22)!important}
body.chat-page:not(.dm-mode) .v27-composer-row #voiceBtn{display:none!important}
body.chat-page.dm-mode .v27-composer-row #voiceBtn{display:inline-flex!important;order:2!important}
body.chat-page.dm-mode .v27-composer-row .composer-attach-wrap{order:3!important}
body.chat-page.dm-mode .v27-composer-row .v27-emoji-btn{order:4!important}
body.chat-page.dm-mode .v27-composer-row .v27-send{order:5!important}

/* Only the message list owns a vertical scrollbar on the chat page. */
body.chat-page main::-webkit-scrollbar,body.chat-page .chatbox::-webkit-scrollbar{display:none!important;width:0!important}
body.chat-page main,body.chat-page .chatbox{scrollbar-width:none!important}

/* Mobile: keep the shell inside the viewport and keep one right-side scrollbar. */
@media(max-width:900px){
  body.chat-page{height:100dvh!important;overflow:hidden!important}
  body.chat-page>main{height:auto!important;flex:1 1 auto!important;padding:7px 0 78px!important;width:calc(100% - 12px)!important}
  body.chat-page .hero{padding:7px 4px 9px!important;min-height:58px!important}
  body.chat-page .hero h1{font-size:26px!important}
  body.chat-page .hero p{font-size:11px!important}
  body.chat-page .chat-layout{display:block!important;height:100%!important;min-height:0!important}
  body.chat-page .users-panel{display:none!important}
  body.chat-page .chatbox{height:100%!important;min-height:0!important;border-radius:19px!important}
  body.chat-page .online-slot{padding:5px 8px!important}
  body.chat-page #messages{padding:10px 7px 10px!important}
  body.chat-page .v27-composer{padding:7px 7px calc(7px + env(safe-area-inset-bottom))!important}
  body.chat-page .v27-composer-row{gap:5px!important}
  body.chat-page .v27-composer-row #text{height:40px!important;min-height:40px!important;max-height:78px!important;padding:9px 10px!important}
  body.chat-page .v27-composer-row .composer-attach-wrap,body.chat-page .v27-composer-row .composer-photo-btn,body.chat-page .v27-composer-row .v27-emoji-btn,body.chat-page .v27-composer-row .v27-send{width:40px!important;height:40px!important;min-width:40px!important}
  body.chat-page #messages .chat-bubble{max-width:91%!important;padding:9px 11px!important}
}

/* v240 — full mobile adaptation of the v239 modern interface. */
@media (max-width:700px){
  *,*::before,*::after{box-sizing:border-box!important;}
  html,body{width:100%!important;max-width:100%!important;overflow-x:hidden!important;}
  body{font-size:15px!important;padding-bottom:72px!important;}
  img,video,iframe,canvas,svg{max-width:100%!important;}
  input,select,textarea,button{max-width:100%!important;font-size:16px!important;}

  header{width:100%!important;padding:8px 12px!important;}
  header .container,header>div{max-width:100%!important;width:100%!important;min-width:0!important;}
  header h1,header .brand,header .site-title{max-width:58vw!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;}
  header nav,.top-nav,.main-nav,.nav-links{max-width:100%!important;overflow-x:auto!important;white-space:nowrap!important;scrollbar-width:none!important;}
  header nav::-webkit-scrollbar,.top-nav::-webkit-scrollbar,.main-nav::-webkit-scrollbar,.nav-links::-webkit-scrollbar{display:none!important;}

  main,.container,.page-container,.content,.page-content{width:100%!important;max-width:100%!important;min-width:0!important;margin-left:auto!important;margin-right:auto!important;}
  main{padding-left:10px!important;padding-right:10px!important;}
  .hero{width:100%!important;max-width:100%!important;padding:12px 10px!important;overflow:hidden!important;}
  .hero h1{font-size:24px!important;line-height:1.15!important;overflow-wrap:anywhere!important;}
  .hero p{font-size:13px!important;line-height:1.35!important;overflow-wrap:anywhere!important;}

  .card,.panel,.profile-card,.profile-panel,.forum-card,.topic-list,.market-card,.announcement-card,.post-card,.feed-card,.settings-card,.admin-card,.stat-card{
    width:100%!important;max-width:100%!important;min-width:0!important;overflow:hidden!important;
  }
  .grid,.cards-grid,.card-grid,.profile-grid,.stats-grid,.admin-stats,.market-grid,.feed-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;width:100%!important;min-width:0!important;gap:8px!important;}
  .grid>* ,.cards-grid>* ,.card-grid>* ,.profile-grid>* ,.stats-grid>* ,.admin-stats>* ,.market-grid>* ,.feed-grid>*{min-width:0!important;max-width:100%!important;}

  .profile-modern,.profile-modern .profile-header,.profile-modern .profile-body,.profile-modern .profile-section,
  .profile-modern .profile-stats,.profile-modern .profile-actions{width:100%!important;max-width:100%!important;min-width:0!important;}
  .profile-modern .profile-stats,.profile-modern .stats-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important;}
  .profile-modern .profile-stats>*{min-width:0!important;overflow:hidden!important;}
  .profile-modern .profile-stats *,.profile-modern .profile-card *{overflow-wrap:anywhere!important;word-break:break-word!important;}
  .profile-modern .profile-actions{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important;}
  .profile-modern .profile-actions>*{min-width:0!important;width:100%!important;}

  .table-wrap,.table-responsive,.responsive-table{width:100%!important;max-width:100%!important;overflow-x:auto!important;-webkit-overflow-scrolling:touch!important;}
  table{min-width:0!important;width:100%!important;}
  th,td{max-width:100%!important;overflow-wrap:anywhere!important;word-break:break-word!important;}

  form{max-width:100%!important;}
  form input,form select,form textarea{width:100%!important;min-width:0!important;}
  .actions,.button-row,.toolbar,.filters,.form-actions{display:flex!important;flex-wrap:wrap!important;gap:7px!important;max-width:100%!important;}
  .actions>* ,.button-row>* ,.toolbar>* ,.filters>* ,.form-actions>*{min-width:0!important;max-width:100%!important;}

  .mobile-nav{left:0!important;right:0!important;bottom:0!important;width:100%!important;height:auto!important;min-height:64px!important;padding:5px max(6px,env(safe-area-inset-left)) calc(5px + env(safe-area-inset-bottom)) max(6px,env(safe-area-inset-right))!important;z-index:1000!important;}
  .mobile-nav a{flex:1 1 0!important;min-width:0!important;width:auto!important;padding:5px 2px!important;}
  .mobile-nav a .nav-icon{font-size:20px!important;line-height:22px!important;}
  .mobile-nav a span:not(.nav-icon){font-size:10px!important;line-height:12px!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;}

  /* Keep the v239 chat composition intact, only make it fit the phone. */
  body.chat-page>main{width:100%!important;max-width:100%!important;padding-left:6px!important;padding-right:6px!important;}
  body.chat-page .chatbox{width:100%!important;max-width:100%!important;min-width:0!important;}
  body.chat-page #messages{width:100%!important;max-width:100%!important;min-width:0!important;overflow-x:hidden!important;}
  body.chat-page #messages .message{max-width:100%!important;min-width:0!important;}
  body.chat-page #messages .chat-bubble{max-width:calc(100vw - 62px)!important;min-width:0!important;overflow-wrap:anywhere!important;word-break:break-word!important;}
  body.chat-page .v27-composer{width:100%!important;max-width:100%!important;}
  body.chat-page .v27-composer-row{width:100%!important;min-width:0!important;}
  body.chat-page .v27-composer-row #text{min-width:0!important;flex:1 1 0!important;}
}

@media (max-width:430px){
  body{font-size:14px!important;}
  main{padding-left:7px!important;padding-right:7px!important;}
  .hero h1{font-size:22px!important;}
  .grid,.cards-grid,.card-grid,.profile-grid,.stats-grid,.admin-stats,.market-grid,.feed-grid{gap:6px!important;}
  .profile-modern .profile-actions{grid-template-columns:1fr 1fr!important;}
  .mobile-nav{min-height:62px!important;}
  .mobile-nav a .nav-icon{font-size:19px!important;}
  .mobile-nav a span:not(.nav-icon){font-size:9px!important;}
  body.chat-page #messages .chat-bubble{max-width:calc(100vw - 54px)!important;padding:8px 10px!important;}
}

/* v245 — floating message emoji popup without a surrounding frame */
.chat-page #messages .quick-reactions,
.chat-page #messages .msg-hover-tools .quick-reactions{
  border:0!important;
  background:transparent!important;
  box-shadow:none!important;
  border-radius:0!important;
  padding:2px!important;
}
.chat-page #messages .quick-reactions .reaction{
  border:0!important;
  box-shadow:none!important;
  background:transparent!important;
}
.chat-page #messages .quick-reactions .reaction:hover,
.chat-page #messages .quick-reactions .reaction.active{border:0!important;box-shadow:none!important;}

/* ===== v247: GLOBAL MODERN UI / THEME RELIABILITY ===== */
html[data-site-theme="dark"] body,
html[data-site-theme="dark"] body.chat-page,
body.site-theme-dark{background:radial-gradient(circle at 15% 0%,rgba(14,165,233,.12),transparent 28%),radial-gradient(circle at 90% 10%,rgba(20,184,166,.10),transparent 24%),#06101f!important;color:#e8f1ff!important;}
html[data-site-theme="dark"] body::before{content:"";position:fixed;inset:0;pointer-events:none;background:linear-gradient(180deg,rgba(2,132,199,.05),transparent 30%);z-index:-1}
html[data-site-theme="dark"] header,
html[data-site-theme="dark"] .profile-card,
html[data-site-theme="dark"] .profile-panel,
html[data-site-theme="dark"] .profile-section-nav,
html[data-site-theme="dark"] .card,
html[data-site-theme="dark"] .panel,
html[data-site-theme="dark"] .box,
html[data-site-theme="dark"] .forum-card,
html[data-site-theme="dark"] .topic-list,
html[data-site-theme="dark"] .market-card,
html[data-site-theme="dark"] .news-card,
html[data-site-theme="dark"] .social-card,
html[data-site-theme="dark"] .users-panel,
html[data-site-theme="dark"] .chatbox{background:linear-gradient(145deg,rgba(10,27,49,.96),rgba(6,18,34,.96))!important;border:1px solid rgba(56,189,248,.20)!important;box-shadow:0 18px 50px rgba(0,0,0,.24),inset 0 1px rgba(255,255,255,.035)!important;color:#e8f1ff!important;}
html[data-site-theme="dark"] .profile-section-nav a,
html[data-site-theme="dark"] .profile-btn,
html[data-site-theme="dark"] .topnav a,
html[data-site-theme="dark"] .profile-nav a{border-radius:14px!important;transition:.2s ease!important;}
html[data-site-theme="dark"] .profile-section-nav a:hover,
html[data-site-theme="dark"] .profile-section-nav a.active{background:linear-gradient(135deg,#0ea5e9,#14b8a6)!important;color:#fff!important;border-color:transparent!important;box-shadow:0 8px 24px rgba(14,165,233,.24)!important;}
html[data-site-theme="dark"] .profile-btn.primary,
html[data-site-theme="dark"] button.primary{background:linear-gradient(135deg,#0ea5e9,#14b8a6)!important;color:#fff!important;border:0!important;box-shadow:0 8px 22px rgba(14,165,233,.22)!important;}
html[data-site-theme="dark"] input,html[data-site-theme="dark"] textarea,html[data-site-theme="dark"] select{background:#071426!important;color:#e8f1ff!important;border:1px solid #24405d!important;}
html[data-site-theme="dark"] input::placeholder,html[data-site-theme="dark"] textarea::placeholder{color:#7890aa!important}
html[data-site-theme="dark"] a{color:#9bdcff}
html[data-site-theme="dark"] .muted,html[data-site-theme="dark"] small{color:#91a7bd}

/* All pages inherit the selected theme even when an older template only sets the html attribute. */
html[data-site-theme="dark"] main,html[data-site-theme="dark"] .page-head,html[data-site-theme="dark"] .hero{color:#e8f1ff!important}
html[data-site-theme="dark"] .mobile-nav{background:rgba(4,13,25,.96)!important;border-color:#24405d!important;backdrop-filter:blur(18px)}
html[data-site-theme="dark"] .mobile-nav a{color:#9fb4ca!important}
html[data-site-theme="dark"] .mobile-nav a.active{color:#38bdf8!important}
html[data-site-theme="dark"] .conversation-row:hover,html[data-site-theme="dark"] .friend-row:hover,html[data-site-theme="dark"] .active-row:hover{background:#11243c!important}

/* Modern non-dark themes: consistent cards, controls and spacing. */
html[data-site-theme="ocean"] body{background:linear-gradient(180deg,#eaf8ff 0,#f7fbff 45%,#eef8ff 100%)!important}
html[data-site-theme="modern"] body{background:linear-gradient(180deg,#f7fbff 0,#f8fafc 48%,#eef6fb 100%)!important}
html[data-site-theme="ocean"] .card,html[data-site-theme="ocean"] .panel,html[data-site-theme="ocean"] .profile-panel,html[data-site-theme="modern"] .card,html[data-site-theme="modern"] .panel,html[data-site-theme="modern"] .profile-panel{border:1px solid rgba(14,165,233,.14)!important;box-shadow:0 16px 42px rgba(15,23,42,.08)!important}

/* Profile: make every section a real, clickable modern tab. */
.profile-modern .profile-section-nav{display:flex!important;gap:8px!important;align-items:center!important;flex-wrap:wrap!important;padding:9px!important;border-radius:18px!important;}
.profile-modern .profile-section-nav a{display:inline-flex!important;align-items:center!important;justify-content:center!important;min-height:42px!important;padding:9px 13px!important;border:1px solid var(--line,#dbe5ef)!important;border-radius:13px!important;text-decoration:none!important;cursor:pointer!important;}
.profile-modern .profile-section-nav a:not(.active){background:rgba(255,255,255,.05)}
.profile-modern .profile-section-nav~#privacyPanel{display:none!important}
.profile-modern .profile-section-nav~#privacyPanel.profile-section-active{display:block!important}
.profile-modern .profile-section-nav~.messages-panel{display:none!important}
.profile-modern .profile-section-nav~.messages-panel.profile-section-active{display:block!important}
.profile-modern .profile-section-nav~.profile-story-block.profile-section-active,.profile-modern .profile-section-nav~.profile-wall.profile-section-active,.profile-modern .profile-section-nav~.profile-friends-panel.profile-section-active,.profile-modern .profile-section-nav~.profile-content.profile-section-active{display:block!important}
.profile-modern .profile-section-nav~.profile-content.profile-section-active{display:grid!important}
.profile-modern .profile-section-nav a:focus-visible{outline:3px solid rgba(14,165,233,.35);outline-offset:2px}

/* Messenger-style conversation cards. */
html[data-site-theme="dark"] .conversation-row{background:rgba(8,23,42,.72)!important;border:1px solid rgba(56,189,248,.12)!important;padding:12px!important;border-radius:16px!important}
html[data-site-theme="dark"] .conversation-row:hover{transform:translateY(-1px);box-shadow:0 10px 26px rgba(0,0,0,.22)}

/* Emoji popup: frameless, floating controls only. */
.chat-page #emojiPicker,.chat-page .emoji-picker,.chat-page .emoji-panel,.chat-page .emoji-menu,.chat-page .emoji-popup{border:0!important;box-shadow:none!important;background:transparent!important;outline:0!important;padding:4px!important;}
.chat-page #emojiPicker *, .chat-page .emoji-picker *, .chat-page .emoji-panel *, .chat-page .emoji-menu *, .chat-page .emoji-popup *{border:0!important;box-shadow:none!important;}
.chat-page #emojiPicker button,.chat-page .emoji-picker button,.chat-page .emoji-panel button,.chat-page .emoji-menu button,.chat-page .emoji-popup button{background:rgba(15,23,42,.78)!important;border-radius:10px!important;padding:6px!important;}

@media(max-width:700px){
 .profile-modern .profile-section-nav{overflow-x:auto!important;flex-wrap:nowrap!important;scrollbar-width:none!important;padding:7px!important;}
 .profile-modern .profile-section-nav::-webkit-scrollbar{display:none!important}
 .profile-modern .profile-section-nav a{flex:0 0 auto!important;white-space:nowrap!important;min-height:40px!important;padding:8px 11px!important;font-size:13px!important;}
 html[data-site-theme="dark"] .profile-modern .profile-section-nav{background:rgba(7,19,35,.92)!important;border:1px solid rgba(56,189,248,.16)!important;backdrop-filter:blur(18px)!important;}
}

/* v250 safety: the main stylesheet must remain CSS; never let legacy popup wrappers add boxes. */
html[data-site-theme="dark"] body,
html.site-theme-dark body,
body.site-theme-dark{background:#06111f!important;color:#e8f1ff!important}
html[data-site-theme="dark"] .card,
html[data-site-theme="dark"] .panel,
html[data-site-theme="dark"] .profile-card,
html[data-site-theme="dark"] .chatbox,
html[data-site-theme="dark"] .chat-layout,
html[data-site-theme="dark"] .profile-panel,
html[data-site-theme="dark"] .messages-panel{background:rgba(7,22,40,.94)!important;color:#e8f1ff!important;border-color:rgba(56,189,248,.18)!important}

/* Reactions/emoji popup: no square wrapper around the floating reactions. */
.chat-page .reaction-picker,
.chat-page .reaction-menu,
.chat-page .quick-reactions,
.chat-page .message-reactions-popup,
.chat-page .reaction-popup,
.chat-page .emoji-popup,
.chat-page .emoji-picker,
.chat-page .emoji-panel,
.chat-page #emojiPanel,
.chat-page #emojiPicker{
  border:0!important; outline:0!important; box-shadow:none!important; background:transparent!important;
}
.chat-page .reaction-picker button,
.chat-page .reaction-menu button,
.chat-page .quick-reactions button,
.chat-page .message-reactions-popup button,
.chat-page .reaction-popup button,
.chat-page .emoji-popup button,
.chat-page .emoji-picker button,
.chat-page .emoji-panel button,
.chat-page #emojiPanel button,
.chat-page #emojiPicker button{
  border:0!important; outline:0!important; box-shadow:none!important;
}


/* v251 — mobile navigation: search is not a bottom-nav destination. */
@media(max-width:700px){
  .mobile-nav a[href="search.php"]{display:none!important;}
  .mobile-nav a{flex:1 1 0!important;min-width:0!important;}
}

/* v251 — one authoritative dark-theme surface for all page shells. */
html[data-site-theme="dark"],
html.site-theme-dark{background:#06111f!important;color:#e8f1ff!important;}
html[data-site-theme="dark"] body,
html.site-theme-dark body,
body.site-theme-dark{background:#06111f!important;color:#e8f1ff!important;}
html[data-site-theme="dark"] header,
html[data-site-theme="dark"] main,
html[data-site-theme="dark"] .sn-card,
html[data-site-theme="dark"] .sn-left,
html[data-site-theme="dark"] .sn-right,
html[data-site-theme="dark"] .city-card,
html[data-site-theme="dark"] .city-section,
html[data-site-theme="dark"] .forum-card,
html[data-site-theme="dark"] .topic-list,
html[data-site-theme="dark"] .market-card,
html[data-site-theme="dark"] .profile-modern,
html[data-site-theme="dark"] .profile-card,
html[data-site-theme="dark"] .profile-panel,
html[data-site-theme="dark"] .chatbox,
html[data-site-theme="dark"] .users-panel{color:#e8f1ff!important;}
html[data-site-theme="dark"] .mobile-nav{background:rgba(4,13,25,.97)!important;color:#e8f1ff!important;}

/* v252: mobile bottom navigation — main five + More menu */
@media (max-width:700px){
  body.mobile-more-open{overflow:hidden!important;touch-action:none!important}
  .mobile-nav{gap:2px!important;}
  .mobile-nav a{flex:1 1 0!important;min-width:0!important;}
  .mobile-more-trigger{cursor:pointer!important;}
  .mobile-more-menu{position:fixed;inset:0;z-index:16000;display:none;}
  .mobile-more-menu.is-open{display:block!important;}
  .mobile-more-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.58);backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);}
  .mobile-more-sheet{position:absolute;left:0;right:0;bottom:0;padding:12px 12px calc(14px + env(safe-area-inset-bottom));background:var(--card,#fff);color:var(--text,#172033);border-top:1px solid var(--line,#dbe3ef);border-radius:22px 22px 0 0;box-shadow:0 -18px 50px rgba(0,0,0,.28);}
  .mobile-more-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;font-size:18px;}
  .mobile-more-head button{width:40px;height:40px;border:0;border-radius:12px;background:rgba(127,145,170,.12);color:inherit;font-size:26px;line-height:1;}
  .mobile-more-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;}
  .mobile-more-grid a{min-height:62px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;text-decoration:none;color:inherit;background:rgba(127,145,170,.09);border:1px solid var(--line,#dbe3ef);border-radius:15px;font-size:22px;}
  .mobile-more-grid a span{font-size:11px;font-weight:800;}
  .mobile-more-grid a.active{border-color:var(--brand,#2563eb);color:var(--brand,#2563eb);background:rgba(37,99,235,.10);}
  html[data-site-theme="dark"] .mobile-more-sheet,body.site-theme-dark .mobile-more-sheet,body.dark .mobile-more-sheet{background:#0b1424!important;color:#e5edf8!important;border-color:#26344b!important;}
  html[data-site-theme="dark"] .mobile-more-grid a,body.site-theme-dark .mobile-more-grid a,body.dark .mobile-more-grid a{background:#101c30!important;border-color:#26344b!important;color:#d9e5f4!important;}
  html[data-site-theme="dark"] .mobile-more-grid a.active,body.site-theme-dark .mobile-more-grid a.active,body.dark .mobile-more-grid a.active{background:rgba(56,189,248,.12)!important;color:#38bdf8!important;border-color:#38bdf8!important;}
}

/* v253 — mobile chat attachment position: text → clip → emoji → send */
@media (max-width:700px){
  body.chat-page .v27-composer-row{display:flex!important;align-items:flex-end!important;gap:6px!important;}
  body.chat-page .v27-composer-row #text{order:1!important;flex:1 1 0!important;min-width:0!important;}
  body.chat-page:not(.dm-mode) .v27-composer-row #voiceBtn{display:none!important;order:99!important;}
  body.chat-page .v27-composer-row .composer-attach-wrap{order:2!important;flex:0 0 40px!important;width:40px!important;height:40px!important;position:relative!important;display:flex!important;align-items:center!important;justify-content:center!important;}
  body.chat-page .v27-composer-row .composer-attach-wrap .composer-photo-btn{order:0!important;display:inline-flex!important;flex:0 0 40px!important;width:40px!important;height:40px!important;margin:0!important;padding:0!important;align-items:center!important;justify-content:center!important;}
  body.chat-page .v27-composer-row .v27-emoji-btn{order:3!important;flex:0 0 40px!important;width:40px!important;height:40px!important;margin:0!important;padding:0!important;}
  body.chat-page .v27-composer-row .v27-send{order:4!important;flex:0 0 40px!important;width:40px!important;height:40px!important;margin:0!important;padding:0!important;}
  body.chat-page.dm-mode .v27-composer-row #voiceBtn{order:2!important;}
  body.chat-page.dm-mode .v27-composer-row .composer-attach-wrap{order:3!important;}
  body.chat-page.dm-mode .v27-composer-row .v27-emoji-btn{order:4!important;}
  body.chat-page.dm-mode .v27-composer-row .v27-send{order:5!important;}
  body.chat-page .composer-attach-wrap .attach-menu{z-index:10020!important;right:0!important;left:auto!important;bottom:calc(100% + 6px)!important;}
}
@media (max-width:430px){
  body.chat-page .v27-composer-row{gap:4px!important;}
  body.chat-page .v27-composer-row .composer-attach-wrap,
  body.chat-page .v27-composer-row .composer-attach-wrap .composer-photo-btn,
  body.chat-page .v27-composer-row .v27-emoji-btn,
  body.chat-page .v27-composer-row .v27-send{width:38px!important;height:38px!important;min-width:38px!important;flex-basis:38px!important;}
}


/* v254 — mobile chat search compact and aligned with the online indicator. */
.chat-page .chat-topline{
  display:flex!important;
  align-items:center!important;
  gap:8px!important;
  width:100%!important;
  min-width:0!important;
  padding:6px 10px!important;
  background:rgba(8,18,32,.72)!important;
  border-bottom:1px solid rgba(148,163,184,.10)!important;
  box-sizing:border-box!important;
  position:relative!important;
  z-index:5000!important;
}
.chat-page .chat-topline .chat-tools{
  flex:1 1 auto!important;
  min-width:0!important;
  width:auto!important;
  padding:0!important;
  margin:0!important;
  background:transparent!important;
  border:0!important;
}
.chat-page .chat-topline .chat-search{width:100%!important;min-width:0!important;}
.chat-page .chat-topline .chat-search input{
  width:100%!important;
  height:36px!important;
  min-height:36px!important;
  padding:7px 11px!important;
  border-radius:11px!important;
  box-sizing:border-box!important;
}
.chat-page .chat-topline .online-slot{
  flex:0 0 auto!important;
  width:auto!important;
  min-height:36px!important;
  height:36px!important;
  margin:0!important;
  padding:0!important;
  display:flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  overflow:visible!important;
}
.chat-page .chat-topline .online-widget{margin:0!important;}
.chat-page .chat-topline #onlineCount{
  height:34px!important;
  min-height:34px!important;
  width:auto!important;
  max-width:145px!important;
  padding:5px 10px!important;
  border-radius:999px!important;
  font-size:12px!important;
  line-height:1.1!important;
  white-space:nowrap!important;
}
@media(max-width:700px){
  .chat-page .chat-topline{gap:6px!important;padding:5px 7px!important;}
  .chat-page .chat-topline .chat-search input{height:34px!important;min-height:34px!important;font-size:14px!important;padding:6px 9px!important;}
  .chat-page .chat-topline .online-slot{height:34px!important;min-height:34px!important;}
  .chat-page .chat-topline #onlineCount{height:32px!important;min-height:32px!important;padding:4px 8px!important;font-size:11px!important;max-width:118px!important;}
  .chat-page .chat-topline #onlinePanel{z-index:2147483000!important;}
}
@media(max-width:380px){
  .chat-page .chat-topline{gap:4px!important;padding-left:5px!important;padding-right:5px!important;}
  .chat-page .chat-topline .chat-search input{font-size:13px!important;}
  .chat-page .chat-topline #onlineCount{max-width:102px!important;padding-left:6px!important;padding-right:6px!important;font-size:10px!important;}
}

/* v255 — compact online indicator + reliable mobile click target */
.chat-page .chatbox .chat-topline .online-slot{position:relative!important;z-index:2147483000!important;overflow:visible!important;pointer-events:auto!important;}
.chat-page #onlineCount{
  min-width:0!important;
  width:auto!important;
  min-height:30px!important;
  height:30px!important;
  padding:4px 9px!important;
  border:1px solid #22c55e!important;
  border-radius:999px!important;
  font-size:12px!important;
  line-height:20px!important;
  font-weight:800!important;
  box-shadow:none!important;
  cursor:pointer!important;
  pointer-events:auto!important;
  touch-action:manipulation!important;
}
.chat-page #onlinePanel{
  width:min(330px,calc(100vw - 20px))!important;
  max-height:min(420px,65vh)!important;
  border-radius:16px!important;
  padding:10px!important;
  z-index:2147483647!important;
  pointer-events:auto!important;
}
@media(min-width:701px){
  .chat-page #onlineCount{font-size:13px!important;min-height:32px!important;height:32px!important;padding:5px 10px!important;}
}

/* Profile → private messages: make the action unmistakably clickable. */
.profile-head-actions .profile-message-link{display:inline-flex!important;align-items:center!important;justify-content:center!important;text-decoration:none!important;}

/* v257 BIG PASS: global theme + responsive polish */
html[data-site-theme="dark"], html.site-theme-dark{color-scheme:dark;background:#06111f!important;}
html[data-site-theme="dark"] body, body.site-theme-dark, body.dark{background:#06111f!important;color:#e8f1ff!important;}
html[data-site-theme="dark"] body:before, body.site-theme-dark:before{opacity:.18}
html[data-site-theme="dark"] header, body.site-theme-dark header{background:rgba(5,16,30,.94)!important;border-color:#22344b!important;color:#e8f1ff!important}
html[data-site-theme="dark"] .topnav a,html[data-site-theme="dark"] .theme-btn,body.site-theme-dark .topnav a,body.site-theme-dark .theme-btn{color:#c7d7e8!important}
html[data-site-theme="dark"] .topnav a:hover,html[data-site-theme="dark"] .theme-btn:hover{background:#12243a!important;color:#38bdf8!important}
html[data-site-theme="dark"] .users-panel,html[data-site-theme="dark"] .chatbox,html[data-site-theme="dark"] .card,html[data-site-theme="dark"] .forum-card,html[data-site-theme="dark"] .topic-list,html[data-site-theme="dark"] .profile-card,html[data-site-theme="dark"] .profile-panel,html[data-site-theme="dark"] .rules-card,html[data-site-theme="dark"] .admin-card,html[data-site-theme="dark"] .market-card,html[data-site-theme="dark"] .sn-card,html[data-site-theme="dark"] .city-card{background:#0a1728!important;color:#e8f1ff!important;border-color:#20354d!important;box-shadow:0 18px 55px rgba(0,0,0,.25)!important}
html[data-site-theme="dark"] .chat-tools,html[data-site-theme="dark"] .composer{background:#091526!important;border-color:#20354d!important}
html[data-site-theme="dark"] #messages{background:linear-gradient(180deg,#071321,#091827)!important}
html[data-site-theme="dark"] .message-body,html[data-site-theme="dark"] .msg-body,html[data-site-theme="dark"] .chat-bubble{background:#102238!important;color:#e8f1ff!important;border-color:#25415e!important}
html[data-site-theme="dark"] .me .message-body,html[data-site-theme="dark"] .me .msg-body{background:linear-gradient(135deg,#087ea8,#0f766e)!important;color:#fff!important}
html[data-site-theme="dark"] .forum-category,html[data-site-theme="dark"] .topic-row,html[data-site-theme="dark"] .conversation-row,html[data-site-theme="dark"] .friend-row,html[data-site-theme="dark"] .active-row{background:#0e1d30!important;color:#e8f1ff!important;border-color:#20354d!important}
html[data-site-theme="dark"] .profile-mini{background:#0e1d30!important}
html[data-site-theme="dark"] input,html[data-site-theme="dark"] textarea,html[data-site-theme="dark"] select{background:#071321!important;color:#e8f1ff!important;border-color:#28435f!important}
html[data-site-theme="dark"] input::placeholder,html[data-site-theme="dark"] textarea::placeholder{color:#7189a2!important}
html[data-site-theme="dark"] .secondary{background:#0e1d30!important;color:#d7e4f1!important;border-color:#29435e!important}
html[data-site-theme="dark"] .quick-btn{color:#c8d7e7!important}.quick-btn:hover{background:#11243a!important}
html[data-site-theme="dark"] .all-chat{background:#103150!important;color:#7dd3fc!important}
html[data-site-theme="dark"] .muted,html[data-site-theme="dark"] .side-title,html[data-site-theme="dark"] .hero p,html[data-site-theme="dark"] .page-head p{color:#8fa7bd!important}
html[data-site-theme="dark"] .profile-hero{background:linear-gradient(135deg,#0b2238,#0d192a)!important;border-color:#24405d!important}
html[data-site-theme="dark"] .mobile-nav{background:rgba(5,14,26,.98)!important;border-color:#243c56!important}
html[data-site-theme="dark"] .mobile-nav a{color:#b8c9da!important}
html[data-site-theme="dark"] .mobile-nav a.active{color:#38bdf8!important}

.chat-page .chatbox{min-height:min(780px,calc(100vh - 150px));height:min(780px,calc(100vh - 150px));}
.chat-page #messages{min-height:0;max-height:none;height:auto;overscroll-behavior:contain;scrollbar-gutter:stable;}
.chat-page .chat-topline{display:grid!important;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:center;}
.chat-page .chat-topline .chat-tools{min-width:0;padding:7px!important;border:0!important;background:transparent!important;}
.chat-page .chat-topline .chat-search{flex:1 1 auto;min-width:0;max-width:520px;}
.chat-page .chat-topline .chat-search input{height:38px;padding:7px 11px;font-size:14px;}
.chat-page .chat-topline .online-slot{justify-self:end;position:relative;z-index:20;}
.chat-page .chat-topline .online-widget{margin:0!important;}
.chat-page #onlineCount{height:38px;white-space:nowrap;cursor:pointer;touch-action:manipulation;}
.chat-page .online-panel{z-index:10050!important;max-height:min(55vh,420px);overflow:auto;}
.chat-page .message{position:relative;width:100%;margin:10px 0;}
.chat-page .chat-bubble{width:fit-content;max-width:min(78%,700px);min-width:0;position:relative;overflow:visible;}
.chat-page .chat-bubble p{overflow-wrap:anywhere;word-break:break-word;margin:7px 0 0;}
.chat-page .msg-hover-tools{position:static!important;width:100%!important;max-width:100%!important;display:flex;flex-wrap:wrap;align-items:center;gap:4px;margin:5px 0 0!important;padding:0!important;background:transparent!important;border:0!important;box-shadow:none!important;opacity:0;transform:translateY(-3px);pointer-events:none;transition:.16s ease;}
.chat-page .message:hover .msg-hover-tools,.chat-page .message.tools-open .msg-hover-tools,.chat-page .msg-hover-tools:focus-within{opacity:1;transform:none;pointer-events:auto;}
.chat-page .quick-reactions{display:flex!important;gap:3px;flex-wrap:wrap;position:static!important;background:transparent!important;border:0!important;box-shadow:none!important;padding:0!important;}
.chat-page .quick-reactions .reaction,.chat-page .reply-btn{border:0!important;background:#17263a!important;color:#d9e8f7!important;border-radius:10px!important;min-width:30px;height:30px;padding:3px 7px!important;box-shadow:none!important;}
.chat-page .quick-reactions .reaction:hover,.chat-page .reply-btn:hover{background:#23415d!important;color:#fff!important;}
.chat-page .reactions{display:flex;flex-wrap:wrap;gap:4px;margin-top:5px;max-width:100%;}
.chat-page .reactions .reaction{border:0;background:rgba(148,163,184,.13);color:inherit;border-radius:999px;padding:3px 7px;line-height:1.1;}
.chat-page .message.me .msg-hover-tools{justify-content:flex-end;}
.chat-page .message.me .chat-bubble{border-bottom-right-radius:7px;}
.chat-page .message:not(.me) .chat-bubble{border-bottom-left-radius:7px;}
.chat-page .load-older-btn{margin:7px auto!important;}
.badge-count{display:inline-flex!important;align-items:center;justify-content:center;min-width:19px;height:19px;padding:0 6px;margin-left:5px;border-radius:999px;background:#ef4444;color:#fff!important;font-size:10px;font-weight:900;vertical-align:middle;box-shadow:0 3px 10px rgba(239,68,68,.25)}
.section-counter{margin-left:auto;min-width:18px;height:18px;padding:0 5px;border-radius:999px;background:#ef4444;color:#fff;font-size:10px;font-weight:900;display:inline-grid;place-items:center}
@media(max-width:900px){.chat-page .chatbox{height:calc(100dvh - 132px);min-height:560px}.chat-page .chat-bubble{max-width:86%}}
@media(max-width:640px){.chat-page .chat-layout{display:block}.chat-page .users-panel{display:none}.chat-page .chatbox{height:calc(100dvh - 96px);min-height:520px;border-radius:18px}.chat-page .chat-topline{grid-template-columns:minmax(0,1fr) auto;padding:2px!important}.chat-page .chat-topline .chat-tools{padding:4px!important}.chat-page .chat-topline .chat-search{max-width:none}.chat-page #onlineCount{font-size:11px;padding:7px 9px;height:34px}.chat-page .chat-topline .chat-search input{height:34px;font-size:13px}.chat-page #messages{padding:10px 8px}.chat-page .chat-bubble{max-width:90%;padding:9px 11px;border-radius:16px}.chat-page .msg-hover-tools{opacity:1;transform:none;pointer-events:auto}.chat-page .quick-reactions .reaction,.chat-page .reply-btn{height:28px;min-width:28px;font-size:12px;padding:2px 6px!important}.chat-page .composer{padding:7px!important}.chat-page .v27-composer-row{gap:4px!important}.chat-page .v27-composer-row #text{min-height:40px!important}.chat-page .v27-composer-row button{width:36px!important;height:36px!important;flex-basis:36px!important}.chat-page .online-panel{position:fixed!important;max-width:calc(100vw - 16px)!important;width:min(340px,calc(100vw - 16px))!important}.badge-count{min-width:17px;height:17px;font-size:9px}}
/* v274 mega stages shared safety layer */
html{overflow-x:hidden}body{overflow-x:hidden}.pc274-active{position:relative}.pc274-active::after{content:"";position:absolute;left:10%;right:10%;bottom:-2px;height:2px;border-radius:99px;background:currentColor;opacity:.7}

/* v302 requested only: remove duplicated bottom navigation across all sections. */
.mobile-nav{display:none!important;}


/* v303 requested-only global cleanup: hide the duplicated bottom navigation. */
.mobile-nav{display:none!important;}

/* v303 requested-only profile alignment: avatar left, identity beside it. */
body.profile-modern .profile-head{display:grid!important;grid-template-columns:132px minmax(0,1fr)!important;gap:18px!important;align-items:end!important;}
body.profile-modern .profile-head .avatar-wrap{grid-column:1!important;grid-row:1!important;justify-self:start!important;}
body.profile-modern .profile-head .profile-title{grid-column:2!important;grid-row:1!important;min-width:0!important;width:auto!important;text-align:left!important;}
body.profile-modern .profile-head .profile-head-actions{grid-column:1/-1!important;grid-row:2!important;justify-content:flex-start!important;}
@media(max-width:900px){body.profile-modern .profile-head{grid-template-columns:104px minmax(0,1fr)!important;gap:12px!important;}body.profile-modern .profile-avatar-xl{width:104px!important;height:104px!important;}}
@media(max-width:640px){body.profile-modern .profile-head{grid-template-columns:92px minmax(0,1fr)!important;gap:10px!important;align-items:start!important;}body.profile-modern .profile-avatar-xl{width:92px!important;height:92px!important;}body.profile-modern .profile-head .profile-title{padding-top:2px!important;padding-bottom:0!important;}}

/* v313 mobile profile bottom navigation recovery */
@media(max-width:700px){body.profile-modern{padding-bottom:calc(76px + env(safe-area-inset-bottom))!important}body.profile-modern>nav.mobile-nav{display:flex!important;position:fixed!important;left:10px!important;right:10px!important;bottom:calc(8px + env(safe-area-inset-bottom))!important;width:auto!important;height:62px!important;min-height:62px!important;z-index:2147483000!important;visibility:visible!important;opacity:1!important;transform:none!important;pointer-events:auto!important;box-sizing:border-box!important;border:1px solid #26364d!important;border-radius:20px!important;background:rgba(7,15,29,.97)!important;box-shadow:0 8px 28px rgba(0,0,0,.35)!important;padding:5px 4px!important}body.profile-modern>nav.mobile-nav>a{display:flex!important;visibility:visible!important;opacity:1!important;flex:1 1 20%!important;min-width:0!important;align-items:center!important;justify-content:center!important;flex-direction:column!important;gap:2px!important;color:#9fb4ce!important;text-decoration:none!important;font-size:20px!important}body.profile-modern>nav.mobile-nav>a span{display:block!important;font-size:9px!important;line-height:1.1!important;white-space:nowrap!important;font-weight:800!important}body.profile-modern>nav.mobile-nav>a[href="profile.php"]{color:#38bdf8!important}}

/* v314: compact profile action buttons on mobile when opening a user from rating */
@media (max-width:640px){
 body.profile-modern .profile-head-actions{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important;width:100%!important;max-width:100%!important;align-items:stretch!important;}
 body.profile-modern .profile-head-actions .profile-btn{display:flex!important;align-items:center!important;justify-content:center!important;width:100%!important;min-width:0!important;min-height:40px!important;height:auto!important;box-sizing:border-box!important;padding:9px 7px!important;font-size:13px!important;line-height:1.2!important;white-space:normal!important;text-align:center!important;border-radius:12px!important;}
 body.profile-modern .profile-head-actions .profile-btn:only-child{grid-column:1/-1!important;}
}
