*{box-sizing:border-box} :root{--blue:#1769e0;--blue-dark:#0e55bf;--ink:#1f2937;--muted:#6b7280;--line:#e5e7eb;--paper:#fff;--bg:#f4f6fb;--soft:#eef4ff;--shadow:0 5px 24px rgba(23,45,80,.06)}
body{margin:0;background:var(--bg);color:var(--ink);font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;font-size:15px;line-height:1.5}
a{color:var(--blue);text-decoration:none}a:hover{color:var(--blue-dark)}button,input,textarea{font:inherit}button{cursor:pointer}
.top{min-height:70px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;gap:24px;padding:10px max(18px,calc((100% - 1400px)/2));position:sticky;top:0;z-index:20;box-shadow:0 2px 8px #1d35570a}
.brand{display:flex;align-items:center;gap:10px;font-size:19px;font-weight:800;letter-spacing:-.4px;color:#172b4d;white-space:nowrap}.brand-mark,.art-bubble{display:grid;place-items:center;background:linear-gradient(145deg,#3187ff,#1254cf);color:#fff;font-weight:900;border-radius:12px;width:38px;height:38px;font-size:26px;line-height:1}
.search{display:flex;align-items:center;gap:4px;max-width:320px;flex:1;background:#f2f5fa;border-radius:24px;padding:4px 8px}.search input{border:0;background:transparent;min-width:0;padding:8px 10px;outline:0}.search button,.inbox-search button{border:0;background:transparent;color:var(--muted);font-size:23px}
.topnav{display:flex;align-items:center;gap:8px;margin-left:auto}.topnav a{padding:9px 12px;border-radius:9px;color:#4b5563;font-weight:650;white-space:nowrap}.topnav a:hover,.topnav a:focus{background:#f0f5ff;color:var(--blue)}.topnav .nav-cta{background:var(--blue);color:#fff}
.page-wrap{max-width:1400px;padding:24px 20px;margin:auto;min-height:72vh}.narrow{max-width:760px;margin:34px auto;padding:0 18px;min-height:65vh}
h1,h2,h3,p{margin-top:0}h1{font-size:28px;letter-spacing:-.7px;margin-bottom:5px}h2{font-size:20px;letter-spacing:-.3px}h3{font-size:15px}.muted,small{color:var(--muted)}.muted{font-size:13px}.inline-note{font-weight:400}.center{text-align:center}.card,.side-card{background:var(--paper);border:1px solid #e9edf4;border-radius:16px;padding:20px;box-shadow:var(--shadow);margin-bottom:16px}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;background:var(--blue);color:white;border:0;border-radius:10px;padding:11px 17px;font-weight:750;transition:background .15s,transform .15s}.btn:hover{background:var(--blue-dark);color:#fff;transform:translateY(-1px)}.btn.full{width:100%;margin-top:4px}.btn.secondary{background:#65758b}.danger-btn{background:#d83b4b}.danger-btn:hover{background:#b92535}
.form{display:grid;gap:15px}.form label,label{display:grid;gap:7px;font-size:13px;font-weight:700;color:#374151}input,textarea,select{width:100%;font:inherit;padding:12px 13px;border:1px solid #d7deea;border-radius:10px;background:#fff;color:var(--ink);outline:0;transition:border .15s,box-shadow .15s}input:focus,textarea:focus,select:focus{border-color:#6da3ff;box-shadow:0 0 0 3px #1769e019}textarea{resize:vertical}.notice,.error{padding:12px 14px;border-radius:10px;margin:12px 0;background:#eaf8ef;color:#1e6b3d;border:1px solid #c8ecd4}.error{background:#fff0f0;color:#a52732;border-color:#ffd3d3}
footer{text-align:center;color:#8490a1;padding:30px 12px;font-size:12px;border-top:1px solid #e8edf5;background:#fff}
.social-layout{display:grid;grid-template-columns:225px minmax(400px,650px) 270px;gap:22px;align-items:start}.left-rail,.right-rail{position:sticky;top:92px}.profile-mini,.side-card{background:#fff;border:1px solid #e8edf4;border-radius:15px;padding:17px;margin-bottom:15px;box-shadow:var(--shadow)}.profile-mini{display:flex;align-items:center;flex-direction:column;text-align:center;gap:7px}.profile-mini .muted{overflow-wrap:anywhere}.profile-mini a{font-weight:700;font-size:13px;margin-top:5px}.avatar{width:42px;height:42px;flex:0 0 auto;border-radius:50%;background:linear-gradient(145deg,#dceaff,#b8d1ff);display:grid;place-items:center;color:#1654b5;font-weight:850;font-size:16px}.avatar.large{width:64px;height:64px;font-size:25px}.avatar.small{width:36px;height:36px;font-size:13px}.avatar.tiny{width:30px;height:30px;font-size:12px}.avatar.jumbo{width:74px;height:74px;font-size:30px}.rail-nav{display:grid;gap:5px}.rail-nav a{padding:11px 13px;display:flex;align-items:center;gap:12px;border-radius:10px;color:#4b5563;font-weight:650}.rail-nav a span{font-size:20px;width:24px;text-align:center}.rail-nav a:hover,.rail-nav a.active{background:#eaf2ff;color:var(--blue)}
.feed-heading{display:flex;align-items:center;justify-content:space-between;margin:2px 0 16px}.feed-heading h1{font-size:25px}.feed-heading p{margin:0}.live-dot{font-size:12px;background:#e8f8ef;color:#27744a;padding:6px 10px;border-radius:30px;font-weight:700}.live-dot:before{content:"";display:inline-block;width:6px;height:6px;background:#2db36a;border-radius:50%;margin:0 6px 1px 0}
.composer{padding:17px 18px}.composer-top{display:flex;align-items:flex-start;gap:12px}.composer-top textarea{border:0;background:#f4f6fa;border-radius:13px;min-height:84px;padding:13px;resize:vertical}.composer-top textarea:focus{box-shadow:inset 0 0 0 1px #a9c7ff}.composer-bottom{display:flex;align-items:center;gap:12px;border-top:1px solid #edf0f5;margin-top:14px;padding-top:12px}.composer-bottom .btn{margin-left:auto;padding:9px 14px}.upload-label{display:inline-flex;align-items:center;gap:7px;cursor:pointer;color:#526174;font-weight:700;font-size:13px}.upload-label input{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}
.post-card{padding:18px 19px;margin-bottom:16px}.post-author{display:flex;align-items:center;gap:11px}.author-meta{display:grid;gap:2px;min-width:0}.author-meta strong{font-size:14px}.author-meta span{font-size:12px;color:#8892a3}.more-link{margin-left:auto;color:#8a94a6;letter-spacing:2px}.post-text{margin:15px 0;white-space:normal;overflow-wrap:anywhere;line-height:1.75;font-size:15px}.post-media{margin:12px -2px 0;border-radius:12px;overflow:hidden;background:#f1f3f7}.post-media img,.post-media video{display:block;max-width:100%;width:100%;max-height:600px;object-fit:contain}.post-stats{display:flex;justify-content:space-between;color:#778294;font-size:12px;padding:13px 2px 9px;border-bottom:1px solid #edf0f5}.post-actions{display:flex;gap:10px;padding:7px 0}.post-actions button{flex:1;border:0;background:transparent;color:#5d6878;padding:9px;border-radius:8px;font-weight:700}.post-actions button:hover{background:#f2f6fc}.post-actions button.liked{color:var(--blue)}.post-actions form{display:flex;flex:1}.post-actions form button{width:100%}.comments{display:grid;gap:10px;padding:5px 0}.comment{display:flex;align-items:flex-start;gap:8px}.comment>div:last-child{background:#f3f5f9;border-radius:12px;padding:8px 11px;min-width:0}.comment strong{font-size:12px}.comment p{font-size:13px;margin:3px 0 0;overflow-wrap:anywhere}.comment-form{display:flex;align-items:center;gap:8px;margin-top:9px}.comment-form input{border-radius:22px;background:#f4f6fa;border:0;padding:11px 14px}.comment-form button{border:0;background:var(--blue);color:white;width:38px;height:38px;border-radius:50%;flex:0 0 auto}.side-title{display:flex;align-items:center;justify-content:space-between;gap:6px}.side-title h3{margin-bottom:13px}.side-title a{font-size:12px;font-weight:700}.person-row{display:flex;gap:10px;align-items:flex-start;padding:12px 0;border-top:1px solid #f0f2f6}.person-meta{display:grid;gap:2px;min-width:0}.person-meta strong{font-size:12px}.person-meta span{font-size:11px;color:#8b95a5;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:160px}.person-meta a{font-size:12px;font-weight:700;margin-top:2px}.safety{background:linear-gradient(140deg,#f0f6ff,#fff);border-color:#deebff}.safety p{font-size:12px;color:#64748b;margin:0;line-height:1.7}.empty-state{text-align:center;padding:38px 20px}.empty-state p{color:var(--muted);max-width:420px;margin:0 auto}.empty-icon,.auth-icon{width:56px;height:56px;border-radius:17px;background:#eaf2ff;color:var(--blue);display:grid;place-items:center;font-size:27px;margin:0 auto 15px}.empty-state h2{margin-bottom:8px}
.auth-shell{max-width:970px;min-height:570px;margin:25px auto;display:grid;grid-template-columns:1fr 1fr;border-radius:22px;overflow:hidden;background:#fff;box-shadow:0 18px 60px #17355a13;border:1px solid #e7edf5}.auth-art{background:radial-gradient(circle at 80% 20%,#5fa1ff 0,#2b74e4 28%,#124db6 100%);color:white;padding:48px;display:flex;flex-direction:column;justify-content:center;position:relative;overflow:hidden}.auth-art:after{content:"";position:absolute;width:280px;height:280px;border:1px solid #ffffff2b;border-radius:50%;right:-80px;bottom:-80px;box-shadow:0 0 0 30px #ffffff0d,0 0 0 60px #ffffff08}.auth-art h1{font-size:38px;line-height:1.13;margin:28px 0 14px}.auth-art p{color:#e0ecff;max-width:300px;line-height:1.8}.art-bubble{background:#ffffff25;border:1px solid #ffffff60;width:54px;height:54px;border-radius:16px;font-size:38px}.auth-panel{padding:48px 44px;display:flex;flex-direction:column;justify-content:center}.auth-panel h1{font-size:28px}.auth-panel>.muted{margin-bottom:26px}.auth-links{display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap;font-size:12px;margin-top:18px}.auth-single{max-width:460px;margin:55px auto;background:#fff;padding:34px;border:1px solid #e6ebf3;border-radius:20px;box-shadow:var(--shadow)}.auth-single h1{text-align:center}.auth-single>p{text-align:center}.auth-single .auth-icon{margin-top:0}.auth-single .center{margin-bottom:0}
.page-heading{margin:4px 0 22px}.page-heading p{margin-bottom:0}.search-wide{display:flex;gap:10px;margin-bottom:20px;max-width:680px}.search-wide .btn{margin:0}.members-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:16px}.member-card{text-align:center}.member-card .avatar{margin:0 auto 12px}.member-card h3{margin-bottom:3px}.member-card p{overflow-wrap:anywhere}.member-card .btn{width:100%}
.messages-shell{display:grid;grid-template-columns:310px minmax(0,1fr);min-height:620px;background:#fff;border:1px solid #e5eaf2;border-radius:18px;overflow:hidden;box-shadow:var(--shadow)}.inbox-panel{border-right:1px solid #e9edf4;min-width:0}.inbox-head{padding:22px 20px 10px}.inbox-head h1{font-size:24px}.inbox-search{display:flex;margin:0 16px 12px;background:#f3f5f9;border-radius:9px;padding:2px 8px}.inbox-search input{border:0;background:transparent;padding:9px}.inbox-list{max-height:500px;overflow:auto}.inbox-person{display:flex;align-items:center;gap:11px;padding:13px 17px;color:inherit;border-top:1px solid #f0f2f6}.inbox-person.selected,.inbox-person:hover{background:#eef4ff}.inbox-person>div:last-child{display:grid;min-width:0;gap:3px}.inbox-person strong{font-size:13px}.inbox-person span{font-size:11px;color:#7b8595;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:200px}.chat-panel{display:flex;flex-direction:column;min-width:0}.chat-head{padding:17px 20px;display:flex;align-items:center;gap:11px;border-bottom:1px solid #edf0f5}.chat-head>div:nth-child(2){display:grid;gap:2px}.chat-head strong{font-size:14px}.online-label{font-size:11px;color:#24955a}.call-shortcut{margin-left:auto;background:#eef4ff;padding:8px 11px;border-radius:8px;font-size:12px;font-weight:800}.chat-history{padding:20px;flex:1;min-height:380px;max-height:520px;overflow:auto;background:linear-gradient(#fbfcfe,#fff)}.message-row{display:flex;margin:9px 0}.message-row.mine{justify-content:flex-end}.bubble{max-width:min(76%,480px);padding:11px 14px;border-radius:15px;background:#eef1f6;overflow-wrap:anywhere;line-height:1.6}.mine .bubble{background:var(--blue);color:white;border-bottom-right-radius:5px}.theirs .bubble{border-bottom-left-radius:5px}.bubble small{display:block;font-size:10px;margin-top:5px;color:inherit;opacity:.72}.chat-compose{display:flex;gap:10px;align-items:flex-end;padding:14px;border-top:1px solid #edf0f5}.chat-compose textarea{border-radius:22px;background:#f4f6fa;border:0;max-height:110px}.chat-compose .btn{width:44px;height:44px;border-radius:50%;padding:0;flex:0 0 auto}.chat-empty{margin:auto;text-align:center;color:#6b7280;padding:35px 20px}.chat-empty h2{color:#263244}.chat-empty p{font-size:13px}.chat-empty .empty-icon{margin-bottom:10px}.welcome{align-self:center}
.settings-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px}.settings-card h3{margin-top:24px}.settings-card hr{border:0;border-top:1px solid #edf0f5;margin:24px 0}.profile-cover{height:92px;background:linear-gradient(120deg,#1769e0,#85b6ff);border-radius:12px;margin:-4px -4px 0}.profile-large-avatar{width:76px;height:76px;border-radius:50%;display:grid;place-items:center;background:#e3edff;color:#1554ba;font-size:32px;font-weight:900;border:4px solid white;margin-top:-38px;position:relative}.settings-card>h2{margin:10px 0 2px}
.call-picker{max-width:760px}.call-people{display:grid;gap:8px}.call-person{display:flex;align-items:center;gap:12px;padding:12px;border:1px solid #edf0f5;border-radius:12px;color:inherit}.call-person:hover{background:#f6f9ff}.call-person>span{display:grid;gap:2px;min-width:0}.call-person small{color:var(--muted);overflow-wrap:anywhere}.call-person b{margin-left:auto;font-size:12px;color:var(--blue)}.call-room{max-width:900px;margin:0 auto}.call-room-head{display:flex;align-items:center;gap:15px}.call-room-head h2{margin-bottom:2px}.videos{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin:18px 0}.video-tile{position:relative;background:#111827;border-radius:14px;overflow:hidden;min-height:220px;aspect-ratio:16/10}.video-tile video{width:100%;height:100%;position:absolute;inset:0;object-fit:cover}.video-tile span{position:absolute;left:12px;bottom:12px;color:white;background:#0008;border-radius:6px;padding:5px 8px;font-size:12px}.call-status{background:#f1f6ff;border-radius:10px;padding:12px;color:#28558f;font-size:13px}.call-controls{display:flex;gap:9px;flex-wrap:wrap}.call-controls button:disabled{opacity:.45;cursor:not-allowed}.tiny-note{font-size:11px;margin-top:16px}
.admin-nav{display:flex;gap:8px;flex-wrap:wrap;margin:14px 0}.admin-nav a{padding:9px 12px;border:1px solid #d1d9e6;border-radius:9px;text-decoration:none;background:white}.admin-item{margin:12px 0;padding:16px;border:1px solid #e1e7f0;border-radius:12px;background:#fff;box-shadow:var(--shadow)}.admin-item form{margin:8px 0}.admin-item input,.admin-item textarea{width:100%;box-sizing:border-box;margin:5px 0 10px;padding:9px;border:1px solid #cbd5e1;border-radius:7px}.admin-item textarea{min-height:75px}.admin-btn{padding:8px 11px;border:0;border-radius:7px;background:#1d4ed8;color:white;cursor:pointer}.admin-btn.danger{background:#b91c1c}.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:10px}.stat{padding:16px;border:1px solid #e1e7f0;border-radius:12px;background:#fff}.stat b{display:block;font-size:25px;color:var(--blue)}
@media(max-width:1100px){.social-layout{grid-template-columns:190px minmax(0,1fr)}.right-rail{display:none}.top{gap:12px}.search{max-width:230px}}
@media(max-width:760px){.top{position:static;flex-wrap:wrap;padding:12px 14px;gap:10px}.brand{font-size:17px}.search{order:3;max-width:none;flex-basis:100%}.topnav{gap:2px}.topnav a{padding:8px;font-size:12px}.page-wrap{padding:16px 10px}.social-layout{display:block}.left-rail{position:static;margin-bottom:15px}.profile-mini{flex-direction:row;text-align:left;justify-content:flex-start;flex-wrap:wrap}.profile-mini .avatar{width:38px;height:38px}.profile-mini .muted{display:none}.profile-mini a{margin-left:auto}.rail-nav{display:flex;overflow:auto}.rail-nav a{white-space:nowrap;padding:9px}.rail-nav a span{display:none}.auth-shell{grid-template-columns:1fr;margin:10px auto}.auth-art{padding:28px;min-height:230px}.auth-art h1{font-size:30px;margin:15px 0 8px}.auth-art p{margin-bottom:0}.auth-panel{padding:28px 23px}.messages-shell{grid-template-columns:1fr;min-height:0}.inbox-panel{border-right:0;border-bottom:1px solid #e9edf4}.inbox-list{display:flex;overflow-x:auto;max-height:none}.inbox-person{min-width:180px;border-top:0;border-right:1px solid #f0f2f6}.inbox-person span{max-width:120px}.chat-history{min-height:300px}.settings-grid{grid-template-columns:1fr}.call-room-head{align-items:flex-start}.videos{gap:8px}.video-tile{min-height:145px}.call-controls .btn{flex:1}.auth-single{margin:15px auto;padding:25px}.feed-heading h1{font-size:22px}}
@media(max-width:430px){.topnav a{font-size:11px;padding:7px}.composer{padding:13px}.composer-bottom{flex-wrap:wrap}.composer-bottom .btn{width:100%;margin-left:0}.videos{grid-template-columns:1fr}.video-tile{min-height:220px}.call-room-head .muted{overflow-wrap:anywhere}.call-controls button{font-size:12px;padding:10px}.search-wide{flex-direction:column}.search-wide .btn{width:100%}}

/* FreeChat refinements */
.brand-wordmark{font-weight:900;font-size:22px;letter-spacing:-.8px;color:#1769e0}.brand-mark{display:none}.art-bubble{font-size:19px}.avatar-photo{object-fit:cover;display:block;border-radius:50%;border:0}.profile-large-avatar.avatar-photo{width:76px;height:76px}.emoji-toggle,.attach-button{border:0;background:#eef4ff;color:#1758b7;border-radius:10px;padding:9px 12px;font-weight:700;cursor:pointer;display:inline-flex;align-items:center;justify-content:center}.emoji-panel{position:fixed;z-index:50;bottom:20px;left:20px;max-width:340px;background:#fff;border:1px solid #dbe3f0;border-radius:14px;box-shadow:0 12px 40px #10204030;padding:10px;display:flex;flex-wrap:wrap;gap:5px}.emoji-panel[hidden]{display:none}.emoji-option{font-size:23px;border:0;background:#f7f9fc;border-radius:8px;padding:5px}.group-create{padding:12px 16px;display:grid;gap:9px;border-bottom:1px solid #edf0f5;background:#fbfcff}.group-create label{font-size:12px;font-weight:700;display:grid;gap:4px}.group-create input,.group-create select{width:100%;padding:8px;border:1px solid #dce3ee;border-radius:8px;background:#fff}.group-create select{min-height:85px}.group-create .btn{margin:0}.chat-compose .attach-button{height:44px;min-width:42px;padding:8px;font-size:20px}.message-attachment{margin-top:8px;max-width:360px}.message-attachment img,.message-attachment video{max-width:100%;max-height:300px;border-radius:10px;display:block}.message-attachment audio{max-width:100%}.voice-hint{font-size:11px;padding:0 15px 10px;margin:0}.audio-only .video-tile{display:none}.audio-tile{display:grid;place-items:center;min-height:160px;background:linear-gradient(145deg,#1769e0,#83b8ff)}.audio-tile video{opacity:0}.freechat-toast{position:fixed;z-index:1000;right:18px;bottom:18px;background:#172b4d;color:#fff;padding:13px 18px;border-radius:12px;box-shadow:0 8px 30px #0003;max-width:min(360px,90vw);font-weight:650}
.transfer-status{display:flex;align-items:center;gap:9px;min-height:20px;padding:0 16px;color:#65738a;font-size:12px}.transfer-ring{--progress:0%;width:25px;height:25px;border-radius:50%;display:inline-grid;place-items:center;background:conic-gradient(#1769e0 var(--progress),#dce5f2 0);position:relative;flex:0 0 auto}.transfer-ring[hidden]{display:none}.transfer-ring:before{content:"";position:absolute;inset:4px;background:#fff;border-radius:50%}.transfer-ring.spinning{background:conic-gradient(#1769e0 0 25%,#dce5f2 25% 100%);animation:transfer-spin .75s linear infinite}.typing-status{padding:0 16px;margin:2px 0;color:#1769e0;font-size:12px;min-height:16px;font-style:italic}.post-upload-status{display:flex;align-items:center;gap:8px;font-size:12px;color:#1769e0}.post-upload-ring{width:25px;height:25px;border-radius:50%;background:conic-gradient(#1769e0 var(--progress,0%),#dce5f2 0);position:relative;flex:0 0 auto}.post-upload-ring:after{content:"";position:absolute;inset:4px;background:#fff;border-radius:50%}@keyframes transfer-spin{to{transform:rotate(360deg)}}

.transfer-status[hidden],.post-upload-status[hidden]{display:none}
/* Professional long-press reaction picker */
.reaction-wrap{position:relative;display:inline-flex;align-items:center}
.reaction-main-form{margin:0}
.reaction-main{touch-action:manipulation;user-select:none}
.reaction-picker{display:flex;align-items:center;gap:5px;position:absolute;left:0;bottom:calc(100% + 9px);padding:7px 9px;background:#fff;border:1px solid #dbe3f0;border-radius:28px;box-shadow:0 8px 28px #14213d24;opacity:0;visibility:hidden;transform:translateY(6px) scale(.96);transition:opacity .15s,transform .15s;z-index:25;white-space:nowrap}
.reaction-picker form{margin:0}
.reaction-picker button{border:0;background:transparent;border-radius:50%;width:36px;height:36px;font-size:24px;display:grid;place-items:center;cursor:pointer;transition:transform .12s,background .12s}
.reaction-picker button:hover,.reaction-picker button:focus{transform:scale(1.25);background:#edf4ff;outline:0}
.reaction-wrap:hover .reaction-picker,.reaction-wrap:focus-within .reaction-picker,.reaction-wrap.reactions-open .reaction-picker{opacity:1;visibility:visible;transform:translateY(0) scale(1)}
.post-media img,.post-media video{display:block;width:100%;max-height:640px;object-fit:contain;background:#f4f6fa}
.post-upload-status{display:flex;align-items:center;gap:10px;padding:10px 14px;color:#334155;font-size:13px}

/* Chat usability polish: compact, responsive composer and message actions */
.chat-panel{min-height:0;position:relative}.chat-head{position:sticky;top:0;z-index:12;background:rgba(255,255,255,.97);backdrop-filter:blur(10px);min-height:70px}.chat-head>div:nth-child(2){min-width:0;flex:1}.chat-head strong{overflow-wrap:anywhere}.chat-history{overscroll-behavior:contain;scroll-behavior:smooth}.message-body{white-space:pre-wrap;overflow-wrap:anywhere}.message-actions{display:flex;gap:10px;justify-content:flex-end;margin-top:4px;opacity:.82}.message-actions button{border:0;background:transparent;color:inherit;font-size:11px;padding:2px 0;text-decoration:underline;text-underline-offset:2px;cursor:pointer}.message-actions button:hover{opacity:1}.reply-quote{display:grid;gap:2px;padding:7px 9px;margin:0 0 7px;border-left:3px solid #8bb6ff;border-radius:5px;background:#dfe9f8;color:#253a5a;font-size:12px}.reply-quote span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}.mine .reply-quote{background:#ffffff22;color:#fff;border-left-color:#fff}.replying-to{display:flex;align-items:center;gap:10px;justify-content:space-between;padding:8px 14px;background:#f0f5ff;color:#244d8b;font-size:12px;border-top:1px solid #e0eaff}.replying-to[hidden]{display:none}.replying-to button{border:0;border-radius:50%;width:27px;height:27px;background:#dbe8ff;color:#244d8b;font-size:20px;line-height:1}.message-emoji-panel{display:flex;flex-wrap:wrap;gap:5px;padding:9px 12px;border-top:1px solid #edf0f5;background:#fff}.message-emoji-panel[hidden]{display:none}.message-emoji-panel .emoji-option{width:36px;height:36px;padding:3px}.chat-compose{gap:7px;padding:10px;align-items:flex-end;background:#fff}.chat-compose textarea{flex:1;min-width:0;min-height:44px;padding:11px 15px;line-height:1.4;overflow-y:auto}.chat-compose .attach-button{flex:0 0 40px;min-width:40px;width:40px;height:42px;padding:5px;border-radius:50%}.chat-compose .btn{height:42px;width:42px}.voice-hint{display:none!important}
@media(max-width:760px){.page-wrap:has(.messages-shell){padding:8px 6px}.messages-shell{display:flex;flex-direction:column;border-radius:13px;overflow:visible;min-height:calc(100dvh - 100px)}.inbox-panel{order:0;flex:0 0 auto;min-width:0}.inbox-head{padding:10px 13px 5px}.inbox-head h1{font-size:19px;margin:0}.inbox-head p{display:none}.group-create{display:none}.inbox-list{padding:5px 5px 8px;gap:4px}.inbox-person{min-width:68px;max-width:82px;flex:0 0 68px;flex-direction:column;justify-content:center;gap:4px;padding:6px 3px;border:0;border-radius:10px;background:transparent;text-align:center}.inbox-person .avatar{width:40px;height:40px;flex:0 0 40px}.inbox-person>div:last-child{width:100%;display:block}.inbox-person strong{display:block;font-size:10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.inbox-person span{display:none}.chat-panel{min-height:calc(100dvh - 205px);flex:1;border-top:1px solid #e8edf4}.chat-head{position:sticky;top:0;padding:10px 11px;gap:8px;min-height:60px}.chat-head .avatar{width:36px;height:36px;flex:0 0 36px}.chat-head strong{font-size:13px;display:block;max-width:45vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.online-label{font-size:10px}.call-shortcut{margin-left:0;padding:7px 8px;font-size:10px;white-space:nowrap}.chat-head .call-shortcut:first-of-type{margin-left:auto}.chat-history{padding:10px 9px;min-height:0;max-height:none;height:calc(100dvh - 340px);flex:1}.bubble{max-width:88%;padding:9px 11px;font-size:14px}.message-attachment{max-width:min(68vw,320px)}.message-attachment img,.message-attachment video{max-height:240px}.chat-compose{padding:8px 7px;gap:5px}.chat-compose .attach-button{width:35px;min-width:35px;flex-basis:35px;height:38px;font-size:17px}.chat-compose .btn{width:38px;height:38px}.chat-compose textarea{min-height:38px;max-height:100px;padding:9px 12px;font-size:14px}.transfer-status,.typing-status{padding-left:10px;padding-right:10px}.chat-empty{padding:24px 12px}.message-emoji-panel{padding:7px;gap:3px}.message-emoji-panel .emoji-option{width:32px;height:32px;font-size:20px}}
@media(max-width:430px){.chat-head{gap:5px}.chat-head strong{max-width:36vw}.call-shortcut{font-size:9px;padding:6px 5px}.chat-history{height:calc(100dvh - 330px)}.chat-compose{gap:4px}.chat-compose .attach-button{width:32px;min-width:32px;flex-basis:32px}.chat-compose .btn{width:36px;height:36px}}

/* Responsive messaging refinements */
.messages-shell,.chat-panel,.chat-history,.chat-compose{min-width:0;max-width:100%;}
.chat-history{overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;}
.message-attachment img,.message-attachment video{height:auto;object-fit:contain;}
.chat-compose textarea{width:100%;}
@media(max-width:760px){.page-wrap:has(.messages-shell){padding:6px 4px;}.messages-shell{width:100%;min-height:calc(100dvh - 88px);}.chat-panel{min-height:0;height:auto;}.chat-history{height:auto;min-height:42dvh;max-height:calc(100dvh - 300px);flex:1 1 auto;}.chat-head{position:relative;top:auto;flex-wrap:nowrap;}.chat-head .call-shortcut{flex-shrink:0;}.chat-compose{position:sticky;bottom:0;z-index:10;flex-wrap:nowrap;padding-bottom:max(8px,env(safe-area-inset-bottom));}.chat-compose textarea{font-size:16px;}.message-attachment{max-width:min(72vw,420px);}.post-media img,.post-media video{max-height:72vh;object-fit:contain;}.composer-bottom{align-items:flex-start;}.upload-guidance{font-size:11px;line-height:1.4;}}

/* Media confirmation and post owner controls */
.media-confirm-dialog{width:min(92vw,460px);border:0;border-radius:18px;padding:0;box-shadow:0 20px 70px #10204045;color:#243247}.media-confirm-dialog::backdrop{background:#07172bcc;backdrop-filter:blur(3px)}.media-confirm-dialog form{padding:22px}.media-confirm-dialog h2{font-size:20px;margin:0 0 6px}.media-confirm-dialog p{font-size:13px;color:#64748b;margin:0 0 14px}.media-confirm-preview{display:flex;justify-content:center;align-items:center;max-height:48vh;overflow:auto;background:#f3f6fb;border-radius:12px;margin-bottom:16px}.media-confirm-preview img,.media-confirm-preview video{display:block;max-width:100%;max-height:45vh;object-fit:contain;border-radius:10px}.media-confirm-actions{display:flex;gap:10px;justify-content:flex-end;flex-wrap:wrap}.btn-secondary{background:#e9eef6;color:#27364c}.post-owner-actions{margin-left:auto;display:flex;align-items:center;gap:8px}.post-owner-actions button{border:0;background:#f0f4fa;border-radius:7px;padding:6px 9px;font-size:12px;cursor:pointer}.post-owner-actions form{margin:0}.composer-bottom input[type=file]{max-width:100%}@media(max-width:520px){.media-confirm-dialog form{padding:16px}.media-confirm-actions{display:grid;grid-template-columns:1fr 1fr}.post-owner-actions{gap:4px}.post-owner-actions button{padding:6px;font-size:11px}}

/* FreeChat social feed + WhatsApp-inspired conversation layout */
.feed-column{min-width:0}.composer,.post-card{border-radius:14px;border-color:#e2e8f0;box-shadow:0 2px 8px rgba(15,35,65,.045)}
.composer-top textarea{font-size:15px;min-height:72px;background:#f1f3f5;border-radius:24px;padding:15px 18px}
.composer-bottom{flex-wrap:wrap}.upload-label{background:#f3f7fc;border:1px solid #e5ebf3;padding:9px 12px;border-radius:9px}.composer-bottom .btn{min-height:40px}
.post-card{padding:16px 18px}.post-author{min-width:0}.post-author .avatar{width:42px;height:42px}.post-media{margin:12px -18px 0;border-radius:0;background:#f0f2f5}.post-media img{width:100%;max-height:680px;object-fit:contain;background:#f0f2f5}.post-stats{padding:12px 2px 9px}.post-actions{border-bottom:1px solid #edf0f5;padding:5px 0}.post-actions button{min-height:40px}.reaction-wrap{position:relative;flex:1;min-width:0}.reaction-wrap>.reaction-main-form{width:100%}.reaction-picker{display:none;position:absolute;z-index:25;left:0;bottom:calc(100% + 5px);padding:7px;background:#fff;border:1px solid #e2e8f0;border-radius:30px;box-shadow:0 8px 28px #10204026;gap:3px;white-space:nowrap}.reaction-wrap.reactions-open .reaction-picker{display:flex}.reaction-picker form{flex:0 0 auto}.reaction-picker button{font-size:23px;padding:4px 6px;transition:transform .12s}.reaction-picker button:hover{transform:scale(1.25)}
.messages-shell{grid-template-columns:minmax(245px,320px) minmax(0,1fr);gap:0;min-height:calc(100dvh - 130px);border:1px solid #dfe5eb;border-radius:14px;overflow:hidden;background:#fff;box-shadow:0 3px 18px #1834510c}.inbox-panel{min-width:0;border-right:1px solid #dfe5eb;background:#fff}.inbox-head{padding:18px 16px 10px}.inbox-head h1{font-size:23px}.inbox-list{max-height:calc(100dvh - 300px);overflow-y:auto}.inbox-person{min-width:0;border-radius:0;padding:12px 14px;border-bottom:1px solid #f0f2f4}.inbox-person.selected{background:#edf5f2;border-left:3px solid #16856b}.inbox-person>div:last-child{min-width:0}.inbox-person strong,.inbox-person span{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.inbox-person span{font-size:12px;color:#6b7b86}.chat-panel{background:#efeae2;min-height:0}.chat-head{background:#f7f9fa;border-bottom:1px solid #dce3e6;padding:12px 16px;min-height:68px}.chat-head .online-label{color:#667780}.chat-back{display:none}.chat-history{background-color:#efeae2;background-image:radial-gradient(rgba(80,100,90,.055) .7px,transparent .7px);background-size:12px 12px;max-height:none;min-height:430px;flex:1;padding:18px clamp(12px,3vw,34px)}.message-row{margin:5px 0}.bubble{max-width:min(78%,520px);border-radius:9px;padding:8px 10px;background:#fff;box-shadow:0 1px 1px #0000000d;line-height:1.45;color:#1e2b32}.mine .bubble{background:#d9fdd3;color:#1e2b32;border-bottom-right-radius:3px}.theirs .bubble{border-bottom-left-radius:3px}.bubble small{font-size:10px;color:#667780;opacity:1;text-align:right}.mine .reply-quote{background:#bfe7b8;color:#24422a;border-left-color:#14866d}.chat-compose{background:#f7f9fa;border-top:1px solid #dce3e6;padding:10px 12px;gap:8px}.chat-compose textarea{background:#fff;border:1px solid #e3e8ec;border-radius:24px;min-height:44px;padding:11px 16px}.chat-compose .attach-button{background:#eef2f3;color:#43545d}.chat-compose .btn{background:#16856b}.chat-compose .btn:hover{background:#0e705a}.message-emoji-panel{background:#f7f9fa}.typing-status,.transfer-status{background:#f7f9fa;margin:0;padding:4px 14px;color:#4e626c}.message-attachment img{max-height:360px;object-fit:contain}.replying-to{background:#e7f3ed;color:#185c4d}
@media(min-width:761px){.chat-panel{height:calc(100dvh - 132px)}.chat-head{flex:0 0 auto}.chat-history{height:auto}.inbox-panel{height:calc(100dvh - 132px);overflow:auto}.group-create{background:#f8fafb}.messages-shell:not(:has(.chat-head)) .chat-panel{display:flex;align-items:center;justify-content:center}}
@media(max-width:760px){.page-wrap:has(.messages-shell){padding:0;margin:0;min-height:calc(100dvh - 64px)}.messages-shell{border:0;border-radius:0;min-height:calc(100dvh - 64px);height:calc(100dvh - 64px);display:flex;flex-direction:column;overflow:hidden}.inbox-panel{border:0;border-bottom:1px solid #dfe5eb;flex:0 0 auto}.inbox-head{padding:10px 14px 5px}.inbox-head h1{font-size:20px}.inbox-list{max-height:none;overflow-x:auto;overflow-y:hidden;display:flex;padding:5px 7px 8px;gap:2px}.inbox-person{min-width:70px;max-width:78px;flex:0 0 70px;padding:7px 3px;border:0;border-radius:10px;display:flex;flex-direction:column;align-items:center;gap:4px}.inbox-person.selected{border-left:0;background:#e8f5ef}.inbox-person>div:last-child{width:100%;text-align:center}.inbox-person strong{font-size:10px}.chat-panel{display:none;flex:1;min-height:0;height:100%;border:0}.messages-shell.has-active-chat .inbox-panel{display:none}.messages-shell.has-active-chat .chat-panel{display:flex;flex-direction:column}.chat-head{position:relative;top:auto;z-index:2;min-height:62px;padding:8px 10px;gap:7px;flex:0 0 auto}.chat-back{display:flex;align-items:center;justify-content:center;flex:0 0 28px;width:28px;height:36px;font-size:31px;line-height:1;color:#16856b}.chat-head .avatar{width:38px;height:38px;flex:0 0 38px}.chat-head>div:nth-child(2){flex:1;min-width:0}.chat-head strong{font-size:14px;max-width:100%;white-space:nowrap}.online-label{font-size:10px}.call-shortcut{padding:7px 8px;font-size:10px;white-space:nowrap;flex:0 0 auto}.chat-head .call-shortcut:first-of-type{margin-left:auto}.chat-history{height:auto;min-height:0;max-height:none;flex:1;padding:12px 9px;overscroll-behavior:contain}.bubble{max-width:88%;font-size:14px;padding:8px 10px}.message-attachment{max-width:min(74vw,340px)}.message-attachment img,.message-attachment video{max-height:38vh}.chat-compose{position:relative;bottom:auto;z-index:5;flex:0 0 auto;padding:7px 6px max(7px,env(safe-area-inset-bottom));gap:4px}.chat-compose .attach-button{width:34px;min-width:34px;flex-basis:34px;height:38px;font-size:17px}.chat-compose textarea{font-size:16px;min-height:38px;max-height:100px;padding:9px 12px}.chat-compose .btn{width:38px;height:38px;flex:0 0 38px}.message-emoji-panel{flex:0 0 auto;max-height:140px;overflow:auto}.typing-status,.transfer-status{font-size:11px}.feed-heading{align-items:flex-start}.feed-heading h1{font-size:23px}.social-layout{display:block}.left-rail{position:static}.left-rail>.profile-mini{display:none}.rail-nav{margin-bottom:12px}.feed-column{width:100%;min-width:0}.right-rail{display:none}.composer,.post-card{border-radius:12px;padding:13px;margin-bottom:12px}.composer-top{gap:8px}.composer-top .avatar{width:36px;height:36px}.composer-top textarea{min-height:58px;padding:12px 14px;font-size:16px}.composer-bottom{gap:7px}.composer-bottom .btn{margin-left:auto;width:auto}.post-media{margin:10px -13px 0;border-radius:0}.post-media img{max-height:68vh}.post-owner-actions{flex-wrap:nowrap}.post-text{font-size:15px}.post-actions{gap:4px}.post-actions button{font-size:13px;padding:8px 3px}.reaction-picker{max-width:94vw;flex-wrap:nowrap}.reaction-picker button{font-size:21px;padding:4px}}
@media(max-width:390px){.chat-head{gap:4px;padding-left:5px;padding-right:5px}.chat-head strong{font-size:12px}.chat-head .avatar{width:32px;height:32px;flex-basis:32px}.call-shortcut{font-size:9px;padding:6px 5px}.chat-compose .attach-button{width:30px;min-width:30px;flex-basis:30px;font-size:15px}.chat-compose{gap:3px}.chat-compose .btn{width:35px;height:35px;flex-basis:35px}.composer-bottom .upload-guidance{display:none}}

/* Expanded inbox and group controls */
.inbox-search{display:flex;align-items:center;gap:8px;margin:0 12px 10px;padding:0 12px;height:40px;border:1px solid #e1e8ed;border-radius:12px;background:#f6f8fa;color:#71808b}
.inbox-search input{width:100%;min-width:0;border:0!important;outline:0;background:transparent!important;padding:8px 0!important;box-shadow:none!important}
.inbox-person[hidden]{display:none!important}
.group-info-panel{padding:12px 16px;background:#fff;border-bottom:1px solid #dce3e6;display:grid;grid-template-columns:1fr auto;gap:12px;align-items:start}
.group-info-panel[hidden]{display:none!important}
.group-info-panel>div:first-child{display:flex;flex-direction:column;gap:4px}.group-info-panel>div:first-child span{font-size:12px;color:#687982}
.group-info-panel form{display:flex;align-items:end;gap:8px;flex-wrap:wrap;margin:0}.group-info-panel label{font-size:12px;display:flex;flex-direction:column;gap:4px;min-width:120px}.group-info-panel input,.group-info-panel select{max-width:220px;border:1px solid #dbe3e8;border-radius:8px;padding:8px;background:#fff}
.message-receipt{display:inline-block;color:#16856b;font-weight:800;letter-spacing:-2px;margin-left:3px}
.message-actions button[data-delete]{color:#b42318}
@media(max-width:760px){.inbox-search{margin:0 10px 7px;height:36px}.group-create{max-height:155px;overflow:auto}.group-info-panel{grid-template-columns:1fr;padding:10px}.group-info-panel form{display:grid;grid-template-columns:1fr}.group-info-panel input,.group-info-panel select{max-width:none;width:100%}}
.comment-actions{display:flex;gap:10px;margin-top:3px}.comment-actions button{border:0;background:transparent;color:#657786;font-size:11px;padding:2px 0;cursor:pointer}.comment-actions button:hover{color:#16856b}.save-post-form{margin:0;display:flex;flex:1}.save-post-form button{width:100%}.post-actions>[data-share-post]{flex:1}
@media(max-width:520px){.save-post-form button,.post-actions>[data-share-post]{font-size:12px;padding:7px 2px}}

/* Final responsive polish: familiar social feed + messenger layout */
.page-wrap{max-width:1480px}
.social-layout{grid-template-columns:230px minmax(0,760px) 285px;justify-content:center;gap:24px}
.feed-column{width:100%;max-width:760px;margin-inline:auto}
.feed-heading{padding:2px 2px 0}
.composer,.post-card{background:#fff;border:1px solid #e1e5eb;border-radius:14px;box-shadow:0 1px 2px rgba(0,0,0,.04)}
.composer{padding:16px}
.composer-top textarea{background:#f0f2f5;border-radius:22px;border:0;min-height:62px}
.composer-bottom{margin-top:12px;padding-top:10px}
.post-card{padding:16px;margin-bottom:14px}
.post-author{gap:10px}
.post-text{font-size:16px;line-height:1.55;margin:13px 0}
.post-media{margin:12px -16px 0;border-radius:0;background:#f0f2f5}
.post-media img{width:100%;max-height:760px;object-fit:contain}
.post-stats{font-size:13px;color:#65676b}
.post-actions{border-top:1px solid #e4e6eb;margin-top:7px;padding-top:6px;gap:5px}
.post-actions button{color:#65676b;border-radius:7px;font-weight:700}
.post-actions button:hover{background:#f0f2f5}
.reaction-main.liked{color:#1877f2}
.reaction-picker{padding:7px 9px;border-radius:32px;box-shadow:0 4px 20px #0002}
.comment>div:last-child{background:#f0f2f5;border-radius:15px}
.comment-form input{background:#f0f2f5}
.mobile-group-toggle{display:none}
.inbox-title-row{display:flex;align-items:center;justify-content:space-between;gap:8px}
@media(min-width:761px){
  .messages-shell{min-height:calc(100dvh - 130px);grid-template-columns:320px minmax(0,1fr)}
  .inbox-panel,.chat-panel{height:calc(100dvh - 130px)}
  .chat-history{min-height:0;padding:20px clamp(18px,3vw,42px)}
  .chat-compose{padding:12px 16px}
  .chat-head{padding:13px 18px}
  .group-create{display:grid}
}
@media(max-width:1100px) and (min-width:761px){
  .social-layout{grid-template-columns:190px minmax(0,1fr);gap:18px}
  .feed-column{max-width:780px}
}
@media(max-width:760px){
  body{background:#f0f2f5}
  .top{position:sticky;top:0;z-index:40;min-height:56px;display:flex;flex-wrap:nowrap;gap:8px;padding:7px 10px;box-shadow:0 1px 3px #0000000b}
  .brand-wordmark{font-size:20px}
  .search{order:initial;flex:1;max-width:none;min-width:0;padding:2px 7px}
  .search input{padding:7px 5px;font-size:14px;min-width:0}
  .search button{font-size:20px}
  .topnav{gap:1px;margin-left:0;flex:0 0 auto}
  .topnav a{padding:7px 6px;font-size:11px}
  .topnav a[href="profile.php"],.topnav a[href="logout.php"],.topnav a[href="call.php"]{display:none}
  .page-wrap{padding:12px 8px;min-height:calc(100dvh - 56px)}
  .social-layout{display:block;width:100%}
  .left-rail{position:static;margin:0 0 9px}
  .left-rail>.profile-mini,.right-rail{display:none!important}
  .rail-nav{display:flex;overflow-x:auto;gap:5px;margin:0 -1px 10px;padding-bottom:2px;scrollbar-width:none}
  .rail-nav::-webkit-scrollbar{display:none}
  .rail-nav a{flex:0 0 auto;white-space:nowrap;padding:8px 11px;background:#fff;border:1px solid #e1e5eb;border-radius:22px;font-size:12px}
  .rail-nav a span{display:inline;width:auto;font-size:15px}
  .feed-heading{margin:5px 2px 12px;align-items:center}
  .feed-heading h1{font-size:22px;margin:0}
  .feed-heading p,.live-dot{display:none}
  .composer,.post-card{border-radius:12px;padding:12px;margin-bottom:10px}
  .composer-top{gap:8px;align-items:flex-start}
  .composer-top .avatar{width:38px;height:38px;flex-basis:38px}
  .composer-top textarea{min-height:62px;padding:12px 14px;font-size:16px}
  .composer-bottom{display:flex;align-items:center;gap:7px;flex-wrap:wrap;padding-top:9px;margin-top:9px}
  .upload-label{padding:8px 10px;font-size:12px}
  .upload-guidance{display:none}
  .composer-bottom .btn{width:auto;margin-left:auto;padding:9px 13px;min-height:38px}
  .post-author .avatar{width:40px;height:40px;flex-basis:40px}
  .author-meta strong{font-size:14px}
  .post-text{font-size:15px;line-height:1.55;margin:11px 0}
  .post-media{margin:10px -12px 0;max-height:none}
  .post-media img{max-height:70dvh;width:100%;object-fit:contain}
  .post-stats{padding:10px 0 7px;font-size:12px}
  .post-actions{gap:2px;padding:5px 0 0}
  .post-actions button{font-size:12px;padding:8px 2px;min-width:0;overflow:hidden;text-overflow:ellipsis}
  .post-owner-actions{margin-left:auto;gap:3px}
  .post-owner-actions button{font-size:11px;padding:5px 7px}
  .comments{gap:8px}
  .comment-form{gap:6px}
  .comment-form .avatar{display:none}
  .comment-form input{font-size:16px;min-width:0}
  .page-wrap:has(.messages-shell){padding:0;margin:0;min-height:calc(100dvh - 56px);height:calc(100dvh - 56px)}
  .messages-shell{height:calc(100dvh - 56px);min-height:0;border:0;border-radius:0;display:flex;flex-direction:column;overflow:hidden;box-shadow:none}
  .inbox-panel{display:flex;flex-direction:column;min-height:0;height:100%;border:0;background:#fff}
  .inbox-head{padding:13px 14px 8px}
  .inbox-head h1{font-size:24px;font-weight:800;margin:0}
  .inbox-head p{display:block;font-size:12px;margin:2px 0 0}
  .inbox-title-row{align-items:center}
  .mobile-group-toggle{display:inline-flex;align-items:center;justify-content:center;border:0;border-radius:22px;background:#e4f3ed;color:#08745e;font-size:12px;font-weight:800;padding:9px 12px;white-space:nowrap}
  .inbox-search{flex:0 0 auto;margin:0 12px 8px;height:40px;border-radius:22px;background:#f0f2f5;border:0}
  .group-create{display:none!important;max-height:45dvh;overflow:auto;padding:12px;margin:0 10px 8px;border:1px solid #dce6e2;border-radius:12px;background:#f7fbf9}
  .inbox-panel.mobile-group-open .group-create{display:grid!important}
  .group-create select{min-height:100px}
  .inbox-list{flex:1;display:block;overflow:auto;max-height:none;padding:0 0 12px}
  .inbox-person{display:flex;flex-direction:row;align-items:center;gap:12px;min-width:0;max-width:none;width:100%;padding:12px 14px;border-bottom:1px solid #f0f2f4;border-radius:0;text-align:left;background:#fff}
  .inbox-person.selected{background:#f1f8f5;border-left:3px solid #16856b}
  .inbox-person .avatar{width:48px;height:48px;flex:0 0 48px;font-size:16px}
  .inbox-person>div:last-child{flex:1;min-width:0;text-align:left;display:grid;gap:4px}
  .inbox-person strong{font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .inbox-person span{display:block;font-size:12px;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#667781}
  .chat-panel{display:none;flex:1;min-height:0;height:100%;border:0;background:#efeae2}
  .messages-shell.has-active-chat .inbox-panel{display:none}
  .messages-shell.has-active-chat .chat-panel{display:flex;flex-direction:column}
  .chat-head{flex:0 0 auto;position:relative;min-height:62px;padding:8px 9px;gap:7px;background:#f7f9fa;z-index:2}
  .chat-back{display:flex;flex:0 0 28px;width:28px;height:40px;align-items:center;justify-content:center;font-size:30px;color:#16856b}
  .chat-head .avatar{width:40px;height:40px;flex:0 0 40px}
  .chat-head>div:nth-child(2){flex:1;min-width:0}
  .chat-head strong{font-size:14px;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .online-label{font-size:11px}
  .call-shortcut{font-size:11px;padding:7px 8px;flex:0 0 auto;white-space:nowrap}
  .chat-history{flex:1;min-height:0;height:auto;max-height:none;overflow-y:auto;overscroll-behavior:contain;padding:12px 9px;background-color:#efeae2}
  .message-row{margin:5px 0}
  .bubble{max-width:86%;font-size:15px;padding:8px 10px;border-radius:9px}
  .message-attachment{max-width:min(76vw,420px)}
  .message-attachment img,.message-attachment video{max-height:42dvh}
  .chat-compose{position:relative;flex:0 0 auto;z-index:5;display:flex;align-items:flex-end;flex-wrap:nowrap;gap:4px;padding:7px 6px max(8px,env(safe-area-inset-bottom));background:#f7f9fa}
  .chat-compose .attach-button{width:35px;min-width:35px;flex:0 0 35px;height:40px;padding:5px;font-size:18px}
  .chat-compose textarea{min-width:0;flex:1;font-size:16px;min-height:40px;max-height:110px;padding:10px 13px;border-radius:22px}
  .chat-compose .btn{width:40px;height:40px;flex:0 0 40px;border-radius:50%}
  .message-emoji-panel{flex:0 0 auto;max-height:140px;overflow:auto}
  .group-info-panel{max-height:40dvh;overflow:auto}
  .group-info-panel form{display:grid;grid-template-columns:1fr}
  .group-info-panel input,.group-info-panel select{width:100%;max-width:none}
}
@media(max-width:390px){
  .top{gap:5px;padding-inline:7px}.brand-wordmark{font-size:18px}.topnav a{font-size:10px;padding:7px 4px}
  .chat-head{gap:4px;padding-inline:5px}.chat-head .avatar{width:35px;height:35px;flex-basis:35px}.call-shortcut{font-size:10px;padding:6px}
  .chat-compose{gap:3px}.chat-compose .attach-button{width:31px;min-width:31px;flex-basis:31px}.chat-compose .btn{width:36px;height:36px;flex-basis:36px}
}


/* FreeChat refinement: contextual message menu, profile post management, keyboard-safe chat */
.message-context-menu{position:fixed;z-index:99999;display:flex;flex-direction:column;min-width:205px;padding:6px;background:#fff;border:1px solid #dbe3ed;border-radius:13px;box-shadow:0 12px 36px rgba(16,34,55,.22);}
.message-context-menu[hidden]{display:none!important}.message-context-menu button{border:0;background:transparent;color:#243447;text-align:left;padding:11px 13px;border-radius:8px;font-size:14px;cursor:pointer}.message-context-menu button:hover{background:#f0f5fa}.message-context-menu button[data-menu="delete-everyone"],.message-context-menu button[data-menu="delete-me"]{color:#b42318}
.message-row{ -webkit-touch-callout:none; }.message-row img{user-select:none;-webkit-user-drag:none}.profile-posts{margin-top:22px;padding:18px}.profile-posts-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}.profile-posts-heading h2{margin:0}.profile-post-item{display:flex;align-items:flex-start;gap:12px;padding:16px 0;border-bottom:1px solid #e9eef4}.profile-post-item:last-child{border-bottom:0}.profile-post-copy{flex:1;min-width:0}.profile-post-copy>span{display:block;font-size:12px;margin-top:3px}.profile-post-copy p{white-space:normal;overflow-wrap:anywhere}.profile-post-copy img,.profile-post-copy video{display:block;max-width:min(100%,420px);max-height:300px;object-fit:contain;border-radius:10px;margin-top:8px}.profile-post-actions{display:flex;gap:6px;align-items:center}.profile-post-actions button{border:1px solid #dce4ee;background:#f6f8fb;border-radius:8px;padding:7px 10px;cursor:pointer}.profile-post-actions form{margin:0}.profile-post-actions form button{color:#b42318}
@media(max-width:760px){body:has(.messages-shell){height:100%;overflow:hidden}.page-wrap:has(.messages-shell){height:calc(var(--fc-vh, 100dvh) - 62px);min-height:0;overflow:hidden;padding:0;margin:0}.messages-shell{height:100%;min-height:0;max-height:100%;}.chat-panel{min-height:0;height:100%;overflow:hidden}.chat-head{position:sticky;top:0;flex-shrink:0}.chat-history{min-height:0;flex:1 1 auto;overflow-y:auto;overscroll-behavior:contain}.chat-compose{position:sticky;bottom:0;flex-shrink:0;padding-bottom:max(8px,env(safe-area-inset-bottom));}.typing-status,.transfer-status,.replying-to,.message-emoji-panel{flex-shrink:0}.profile-post-item{flex-direction:column}.profile-post-actions{align-self:flex-end}.profile-posts{padding:13px}.message-context-menu{min-width:190px;max-width:calc(100vw - 16px)}}

.attach-menu-wrap{position:relative;display:flex;align-items:center;flex:0 0 auto}.attachment-menu{position:absolute;left:0;bottom:calc(100% + 10px);z-index:1000;min-width:220px;padding:7px;background:#fff;border:1px solid #dce5ee;border-radius:13px;box-shadow:0 10px 32px #18345126;display:flex;flex-direction:column}.attachment-menu[hidden]{display:none!important}.attachment-menu button{border:0;background:transparent;text-align:left;padding:11px 12px;border-radius:8px;color:#26394d;cursor:pointer;font-size:14px}.attachment-menu button:hover{background:#f0f5fa}@media(max-width:760px){.attachment-menu{bottom:calc(100% + 8px);min-width:205px}.chat-compose .attach-menu-wrap .attach-button{width:36px;min-width:36px;flex-basis:36px}}

/* Refined mobile feed composer and visible logout label */
.upload-label{background:linear-gradient(135deg,#fff4e8,#ffe7f1);border:1px solid #ffd7e4;color:#3e4a5b;padding:10px 14px;border-radius:13px;box-shadow:0 3px 10px #d9487b12}.gallery-icon{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:11px;background:linear-gradient(135deg,#ff9a44,#f04f91 58%,#7c5cff);color:#fff;font-size:23px;box-shadow:0 4px 12px #ed659344}.reaction-picker{gap:5px;padding:8px 10px}.reaction-picker button{font-size:25px;min-width:37px;min-height:40px}.reaction-wrap.reactions-open .reaction-picker{animation:reaction-pop .14s ease-out}@keyframes reaction-pop{from{opacity:0;transform:translateY(5px) scale(.96)}to{opacity:1;transform:translateY(0) scale(1)}}
@media(max-width:760px){.topnav a[href="logout.php"]{display:inline-flex!important;align-items:center;gap:4px;background:#f1f6ff;color:#1769e0;padding:8px 10px;font-size:12px;border:1px solid #e0eaff}.topnav a[href="logout.php"]::before{content:"↪";font-size:16px}.upload-label{gap:8px;padding:7px 10px}.composer-bottom .btn{width:auto;margin-left:auto}.composer-bottom{flex-wrap:nowrap}.upload-guidance{display:none}}
