*{box-sizing:border-box}html,body{height:100%}body{margin:0;font-family:Tahoma,Arial,sans-serif;color:#111;background:#faf7f3}a{text-decoration:none;color:inherit}.hidden{display:none!important}:root{--main:#a9001f;--soft:#fff6eb;--line:#dedede;--green:#46b983;--blue:#0789e8}.login-page,.install-page{min-height:100vh;display:grid;place-items:center;background:radial-gradient(circle at top,#fff 0,#fff 28%,#f7efe8 70%,#eadfd7)}.login-card,.install-box{width:min(500px,94vw);background:#fff;border:1px solid #eadbd2;border-radius:18px;box-shadow:0 20px 60px #0001;padding:24px}.logo{width:72px;height:72px;background:var(--main);color:#fff;border-radius:50%;display:grid;place-items:center;font-size:36px;margin:0 auto 10px}.login-card h1,.install-box h1{margin:6px 0 8px;text-align:center;color:var(--main);font-size:32px}.login-card p{text-align:center;color:#666}.tabs{display:flex;gap:6px;background:#f4eee8;border-radius:14px;padding:5px;margin:15px 0}.tabs button{flex:1;border:0;background:transparent;border-radius:10px;padding:10px;cursor:pointer;font-weight:bold}.tabs button.active{background:var(--main);color:#fff}label{display:block;margin:10px 0 5px;font-weight:bold}input,textarea,select{width:100%;border:1px solid #d7d7d7;border-radius:9px;padding:10px;font-family:Tahoma,Arial;background:#fff;font-size:15px}textarea{min-height:90px;resize:vertical}.btn,button.btn{border:0;background:var(--main);color:#fff;border-radius:11px;padding:12px 16px;cursor:pointer;font-weight:bold;margin-top:12px;display:inline-block}.alert{padding:12px;border-radius:12px;margin:10px 0;line-height:1.6}.alert.ok{background:#eaffea;color:#087220}.alert.bad{background:#ffe7e7;color:#a10000}.login-foot,.install-note{text-align:center;color:#777;margin-top:18px;font-size:12px}.chat-page{height:100vh;overflow:hidden;background:#fff}.chat-page:before{content:"";position:fixed;inset:0;background:linear-gradient(45deg,transparent 0 40%,rgba(120,90,90,.09) 40% 50%,transparent 50% 100%);background-size:285px 285px;z-index:-1}#app{height:100vh;display:flex;flex-direction:column;direction:rtl}.topbar{height:62px;background:var(--main);display:flex;align-items:center;gap:7px;padding:6px 6px 6px 8px;border-bottom:2px solid #d7c6ba;color:#fff;direction:ltr;box-shadow:0 1px 0 #fff inset}.sound-btn{width:54px;height:54px;border-radius:50%;border:3px solid rgba(255,255,255,.15);background:#bd0028;color:#f07;font-size:28px;display:grid;place-items:center;cursor:pointer;box-shadow:inset 0 0 0 2px #91051e}.mic-seats{display:flex;align-items:center;gap:5px;overflow-x:auto;flex:1;height:100%;padding:0 3px}.mic-seats::-webkit-scrollbar{height:0}.mic-seat{min-width:55px;height:55px;border-radius:50%;border:3px solid #fff;background:#fff;color:#0b0b0b;display:flex;align-items:center;justify-content:center;font-size:30px;position:relative;cursor:pointer;box-shadow:0 1px 3px #0004;overflow:hidden}.mic-seat:before{content:"🎙"}.mic-seat.busy:before{content:""}.mic-seat.busy{background:#fff4ef}.mic-seat.mine{outline:3px solid #ffe200}.mic-seat.locked{opacity:.5}.mic-seat img{width:49px;height:49px;border-radius:50%;object-fit:cover}.mic-seat small{position:absolute;bottom:0;right:0;left:0;background:#000a;color:#fff;font-size:9px;border-radius:8px 8px 0 0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.site-mini{font-weight:bold;white-space:nowrap;margin-left:8px}.ad-slot{background:#fff;text-align:center;padding:6px;border-bottom:1px solid var(--line);min-height:32px}.chat-wrap{flex:1;overflow:hidden;display:flex;flex-direction:column;min-height:0}.room-title{height:0;overflow:hidden}.messages{flex:1;overflow-y:auto;padding:0 0 8px;background:rgba(255,255,255,.42)}.messages::-webkit-scrollbar,.panel-body::-webkit-scrollbar{width:9px}.messages::-webkit-scrollbar-thumb,.panel-body::-webkit-scrollbar-thumb{background:#222;border-radius:10px}.msg{display:grid;grid-template-columns:82px 1fr 72px;gap:8px;align-items:start;min-height:74px;padding:7px 5px;border-bottom:1px solid #dedede;background:#fff1e7e8;direction:ltr}.msg:nth-child(even){background:#e8e8e8e8}.msg.system,.msg.notice{background:#d7d7d7e8}.msg .avatar{width:74px;height:64px;border-radius:2px;border:1px solid #d9d9d9;object-fit:cover;background:#fff}.msg .content{direction:rtl;text-align:right}.msg .name{font-weight:bold;color:#111;margin-bottom:4px;display:inline-flex;align-items:center;gap:4px;max-width:100%;font-size:17px}.msg .namepill{display:inline-block;background:#fff;border-radius:7px;padding:1px 8px;box-shadow:0 1px 2px #0001}.msg .ranktag{background:var(--main);color:#fff;border-radius:5px;padding:4px 7px;margin-inline-start:4px;font-size:14px;font-weight:bold;display:inline-block}.msg .text{white-space:pre-wrap;word-break:break-word;line-height:1.65;font-size:16px}.msg.system .name,.msg.notice .name{color:#df0028}.msg.system .text,.msg.notice .text{color:#111;font-weight:bold}.msg.notice .text{color:#91051e}.msg .time{font-size:13px;color:#333;text-align:left;white-space:nowrap;direction:rtl;padding-top:7px}.msg .time b{font-weight:400}.msg .del{border:0;background:#0001;border-radius:8px;padding:2px 7px;cursor:pointer;margin-top:6px}.sendbar{height:50px;background:#fff;border-top:1px solid #ddd;display:flex;align-items:center;gap:6px;padding:5px;direction:ltr;z-index:20}.sendbar input{height:38px;border-radius:24px;direction:rtl;flex:1;padding:7px 12px}.round{width:36px;height:36px;border-radius:50%;border:1px solid #2491ff;background:#fff;font-size:19px;cursor:pointer;display:grid;place-items:center}.emoji-round{border-color:#9c8d50;background:#fffce8}.send{width:46px;height:41px;border-radius:50%;border:2px solid #1684ff;background:#fff;color:#000;font-size:24px;line-height:1;transform:rotate(180deg);cursor:pointer}.bottom-nav{height:47px;background:var(--main);display:flex;align-items:center;border-top:2px solid #fff;overflow-x:auto;direction:ltr;z-index:22}.bottom-nav button,.bottom-nav a{min-width:100px;height:45px;border:0;border-left:1px solid #fff;background:transparent;color:#fff;font-weight:bold;font-size:15px;display:flex;align-items:center;justify-content:center;gap:4px;cursor:pointer;direction:rtl}.bottom-nav button.active{background:#0789e8}.bottom-nav .users-count{min-width:80px;border:1px solid #fff;border-radius:0 18px 0 0}.bottom-nav #pmBadge:not(:empty),.bottom-nav #wallBadge:not(:empty){background:#fff;color:var(--main);border-radius:999px;padding:1px 6px;font-size:11px}.side-panel{position:fixed;right:6px;top:70px;bottom:56px;width:405px;background:#fff;border:5px solid #d7d7d7;border-radius:13px;box-shadow:-18px 0 45px #0004;z-index:80;overflow:hidden;display:flex;flex-direction:column}.side-panel-head{height:47px;background:var(--main);color:#fff;display:flex;align-items:center;justify-content:center;position:relative;border-bottom:1px solid #e3e3e3}.panel-tab{height:41px;min-width:205px;background:var(--green);color:#fff;border-radius:0 0 26px 26px;display:flex;align-items:center;justify-content:center;font-weight:bold;margin-top:-6px}.panel-close{position:absolute;right:8px;top:6px;width:34px;height:34px;border:0;border-radius:7px;background:#e64b59;color:#fff;font-size:28px;line-height:1;cursor:pointer;font-weight:bold}.panel-body{flex:1;overflow-y:auto;background:#fff;padding:6px}.section-title{background:var(--main);color:#fff;font-weight:bold;text-align:center;padding:11px;margin:5px 0}.classic-search{display:flex;gap:4px;margin-bottom:6px;align-items:center}.classic-search input{height:39px;border-radius:0}.classic-search button{width:38px;height:38px;background:var(--main);color:#fff;border:0;border-radius:5px;font-size:20px}.youtube-badge{background:#fff;color:#e21;font-weight:bold;border-radius:3px;line-height:1;padding:2px 3px;text-align:center;border:1px solid #eee}.list-item{display:flex;gap:10px;align-items:center;padding:9px;border-bottom:1px solid #eee;cursor:pointer;background:#fff}.list-item:hover{background:#fff7ef}.list-item img{width:56px;height:56px;border-radius:7px;object-fit:cover}.list-item .meta{font-size:12px;color:#777;line-height:1.5}.pill{display:inline-block;background:#f3ece7;border-radius:99px;padding:3px 8px;font-size:12px;color:#555}.room-card{height:72px;margin:0 0 8px;background:#fff;border-bottom:1px solid #ddd;display:grid;grid-template-columns:64px 1fr 46px;gap:6px;align-items:center;cursor:pointer;position:relative;box-shadow:0 2px 8px #0001;overflow:hidden}.room-card:before{content:"";position:absolute;inset:0;background:linear-gradient(45deg,transparent 0 44%,rgba(120,90,90,.08) 44% 55%,transparent 55%);background-size:135px 135px}.room-card > *{position:relative}.room-card img{width:58px;height:58px;object-fit:cover;margin-right:4px;border-radius:3px}.room-card b{font-size:16px}.room-card .desc{font-size:12px;color:#777;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:230px}.room-stats{align-self:stretch;display:flex;flex-direction:column;justify-content:space-between;align-items:center;padding:4px 0}.room-count{background:var(--main);color:#fff;border-radius:2px;padding:2px 5px;font-weight:bold}.room-mic{font-size:17px}.add-room{width:100%;height:34px;background:#2ca746;color:#fff;border:0;border-radius:6px;font-weight:bold;margin:0 0 8px;font-size:16px}.member-strip{display:flex;gap:5px;overflow-x:auto;padding:4px 2px 8px}.member-strip img{width:58px;height:58px;object-fit:cover;border-radius:7px;border:1px solid #ddd}.member-card{display:grid;grid-template-columns:62px 1fr 54px;gap:7px;min-height:74px;border-bottom:1px solid #eee;background:#fff;padding:7px 4px;align-items:center}.member-card img{width:58px;height:58px;border-radius:50%;object-fit:cover}.member-card .rankno{font-size:22px;color:#999;font-weight:bold}.member-card .username{font-weight:bold;color:#850016}.member-card .status{font-size:13px;color:#333;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.flag{font-size:13px}.online-dot{display:inline-block;width:7px;height:44px;background:#21d44a;border-radius:4px;margin-left:4px}.pm-empty{height:calc(100vh - 210px);background:#fff;box-shadow:inset 0 0 28px #ddd;margin-top:6px}.pm-box{border:1px solid #eee;border-radius:8px;height:270px;overflow:auto;padding:10px;background:#fafafa}.pm-msg{max-width:82%;padding:8px 10px;border-radius:12px;margin:6px 0;background:#fff;border:1px solid #eee}.pm-msg.mine{margin-right:auto;background:#e8f8ff}.pm-send{display:flex;gap:6px;margin-top:8px}.wall-post{border:1px solid #91bdff;border-radius:5px;margin:8px 0;padding:6px;background:#fff;box-shadow:0 3px 8px #0002;position:relative;min-height:95px}.wall-post:before{content:"";position:absolute;inset:0;background:linear-gradient(45deg,transparent 0 44%,rgba(120,90,90,.07) 44% 55%,transparent 55%);background-size:140px 140px;pointer-events:none}.wall-post > *{position:relative}.wall-post-head{display:grid;grid-template-columns:58px 1fr 28px;gap:6px;align-items:start;color:#336d1c;font-weight:bold}.wall-post-head img{width:54px;height:54px;border-radius:5px;object-fit:cover}.wall-post p{white-space:pre-wrap;line-height:1.6;margin:4px 0;color:#336d1c;font-size:16px}.wall-actions{display:flex;align-items:center;gap:10px;justify-content:center;margin-top:5px}.heart{height:28px;min-width:48px;background:#fff;border:0;border-radius:14px;color:#e00;font-weight:bold;box-shadow:0 2px 8px #0002;cursor:pointer}.comment-count{background:#050505;color:#fff;border-radius:7px;padding:5px 8px;font-size:12px}.delete-x{position:absolute;left:6px;bottom:7px;width:22px;height:22px;border:0;border-radius:50%;background:#e64559;color:#fff;font-weight:bold;cursor:pointer}.wall-sendbar{display:flex;gap:4px;align-items:center;position:sticky;bottom:0;background:#fff;padding:5px 0}.wall-sendbar input{height:36px;border-radius:5px}.wall-sendbar button{height:36px;border:0;background:var(--main);color:#fff;border-radius:4px;font-weight:bold}.mini-btn{border:0;border-radius:8px;background:var(--main);color:#fff;padding:8px 10px;cursor:pointer;font-weight:bold}.mini-btn.light{background:#eee;color:#111}.settings-panel label{margin:0}.settings-row{display:grid;grid-template-columns:92px 1fr;align-items:center;gap:5px;margin:4px 0}.settings-row .tag{background:var(--main);color:#fff;padding:6px 8px;border-radius:2px;font-weight:bold;text-align:center}.settings-row input,.settings-row select{height:35px;padding:6px;border-radius:7px}.settings-save{position:absolute;left:8px;top:255px;background:#29a84a;color:#fff;border:0;border-radius:8px;height:37px;font-weight:bold}.img-line{height:42px;border:1px solid #ddd;border-radius:20px;display:flex;align-items:center;gap:8px;padding:4px;background:#fff;box-shadow:0 1px 7px #0002;margin:7px 0}.img-line img{width:34px;height:34px;object-fit:cover;border-radius:4px}.toggle-row{height:42px;border:1px solid #ddd;border-radius:19px;display:flex;align-items:center;justify-content:space-between;padding:3px 8px;margin:5px 0;box-shadow:0 1px 6px #0002}.toggle-pill{background:#27a84c;color:#fff;border-radius:18px;padding:7px 14px;font-weight:bold}.danger-wide{width:100%;height:41px;background:#df5050;color:#fff;border:0;border-radius:20px;font-weight:bold;margin:5px 0}.admin-body{background:#f6f1ec;min-height:100vh}.admin-wrap{max-width:1100px;margin:auto;padding:18px}.admin-head{background:var(--main);color:#fff;border-radius:16px;padding:16px;display:flex;justify-content:space-between;align-items:center}.cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px;margin:14px 0}.card{background:#fff;border:1px solid #e6d8cf;border-radius:16px;padding:15px}.table{width:100%;border-collapse:collapse;background:#fff;border-radius:14px;overflow:hidden}.table th,.table td{border-bottom:1px solid #eee;padding:10px;text-align:right}.table th{background:#fff5ed;color:var(--main)}@media(max-width:780px){.topbar{height:57px}.mic-seat{min-width:47px;height:47px;font-size:24px}.mic-seat img{width:42px;height:42px}.sound-btn{width:45px;height:45px;font-size:22px}.site-mini{display:none}.msg{grid-template-columns:54px 1fr 48px;min-height:64px;padding:5px}.msg .avatar{width:50px;height:50px}.msg .name{font-size:15px}.msg .text{font-size:15px}.msg .time{font-size:10px}.bottom-nav button,.bottom-nav a{min-width:82px;font-size:13px}.bottom-nav .users-count{min-width:65px}.side-panel{right:3px;left:3px;width:auto;top:61px;bottom:50px}.sendbar{height:48px}.login-card,.install-box{border-radius:0;min-height:100vh;width:100vw}.room-card .desc{max-width:180px}.settings-save{position:static;width:100%;margin:5px 0}.settings-row{grid-template-columns:86px 1fr}}

/* BA v18 member profile modal like classic chat screenshot */
.profile-overlay{position:fixed;inset:0;z-index:2147483000;display:flex;align-items:flex-start;justify-content:center;direction:rtl;font-family:Tahoma,Arial,sans-serif}.profile-shade{position:absolute;inset:0;background:rgba(0,0,0,.48)}.profile-card{position:relative;margin-top:28px;width:430px;max-width:calc(100vw - 14px);max-height:calc(100vh - 56px);overflow-y:auto;background:#fff;border:3px solid #2b2b2b;border-radius:7px;box-shadow:0 15px 60px rgba(0,0,0,.45);color:#111}.profile-close{position:absolute;left:6px;top:6px;width:29px;height:29px;background:#9b0014;color:#fff;border:0;border-radius:4px;font-size:22px;font-weight:bold;line-height:1;z-index:5;cursor:pointer}.profile-cover{height:118px;background:#060606;background-image:radial-gradient(circle at 25% 20%,rgba(255,255,255,.14),transparent 25%),linear-gradient(45deg,#000,#222);background-size:cover;background-position:center;overflow:hidden;position:relative}.profile-cover-title{position:absolute;left:0;right:0;top:-18px;text-align:center;font-size:56px;line-height:1.1;font-weight:900;color:#fff;text-shadow:0 4px 0 #aaa,0 8px 20px #000;letter-spacing:-2px}.profile-top{min-height:135px;padding:0 16px 8px;display:grid;grid-template-columns:118px 1fr 120px;gap:8px;align-items:start}.profile-avatar{width:128px;height:128px;border-radius:50%;object-fit:cover;border:4px solid #fff;box-shadow:0 0 0 1px #bbb;margin-top:-64px;background:#fff}.profile-info{padding-top:8px;text-align:center;min-width:0}.profile-info h2{font-size:21px;margin:0 0 3px;color:#333;font-weight:900}.profile-ip{font-size:17px;font-weight:bold;direction:ltr;color:#222}.profile-note{font-size:14px;min-height:20px;color:#333;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.profile-country{font-size:14px;text-align:right;margin-top:6px}.profile-room-tag{align-self:center;justify-self:end;background:#930014;color:#fff;border-radius:4px;padding:6px 8px;font-size:18px;font-weight:bold;max-width:116px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.profile-stats{display:flex;align-items:center;justify-content:space-between;padding:0 18px 7px;font-size:15px;font-weight:bold}.profile-stats .stars{font-size:23px;letter-spacing:1px;color:#222;text-shadow:0 1px 2px #aaa}.profile-badges{display:flex;justify-content:center;gap:7px;padding:2px 8px 9px;filter:drop-shadow(0 2px 2px #aaa)}.profile-badges i{width:42px;height:42px;border-radius:50%;display:grid;place-items:center;font-style:normal;font-size:26px;color:#777;background:radial-gradient(circle,#fff 0,#d7d7d7 55%,#8d8d8d 100%);border:1px solid #ddd}.profile-actions{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;padding:0 9px 8px}.profile-actions button{height:35px;border:1px solid #d7dfea;background:#fff;border-radius:6px;font-weight:bold;font-size:14px;color:#222;cursor:pointer;box-shadow:inset 0 -1px 0 #eee}.profile-actions button:hover{background:#f7f7f7}.profile-actions .blue{color:#1758ff}.profile-actions .red{color:#d90000}.profile-actions .purple{color:#c000ff}.profile-actions .orange{color:#fa9a00}.profile-actions .prof-heart{color:red;font-size:18px}.profile-admin-lines{border-top:2px solid #333;margin:0 5px 6px;padding-top:5px}.profile-control{display:grid;grid-template-columns:80px 1fr 74px;align-items:center;gap:0;margin:5px 0;border:1px solid #777;background:#fff;height:43px}.profile-control label{height:41px;background:#89000d;color:#fff;display:grid;place-items:center;font-weight:bold;font-size:17px}.profile-control input,.profile-control select{width:100%;height:39px;border:0;border-left:1px solid #ccc;border-right:1px solid #ccc;border-radius:0;padding:5px 8px;background:#fff;font-size:17px;font-weight:bold;text-align:center}.profile-control button{height:39px;margin:0 3px;background:#8a000d;color:#fff;border:0;border-radius:3px;font-size:17px;font-weight:bold;cursor:pointer}.profile-control button:before{content:'💾 ';font-size:14px}@media(max-width:780px){.profile-card{margin-top:12px;width:calc(100vw - 12px);max-height:calc(100vh - 24px)}.profile-top{grid-template-columns:100px 1fr 94px;padding:0 8px 8px}.profile-avatar{width:105px;height:105px;margin-top:-50px}.profile-room-tag{font-size:14px;max-width:92px}.profile-cover-title{font-size:45px}.profile-actions{grid-template-columns:repeat(2,1fr)}.profile-control{grid-template-columns:72px 1fr 66px}.profile-control label,.profile-control input,.profile-control select,.profile-control button{font-size:14px}}

/* BA v17 hard cleanup: no blocking black/gray overlay */
.side-panel{z-index:2147482000!important}
.panel-body input,.panel-body textarea,.panel-body select,.panel-body button{pointer-events:auto!important}
.profile-card.in-panel{position:relative!important;display:block!important;margin:0 auto 8px!important;width:100%!important;max-width:100%!important;max-height:none!important;overflow:visible!important;border:2px solid #2b2b2b!important;border-radius:7px!important;box-shadow:0 3px 14px rgba(0,0,0,.18)!important;background:#fff!important;color:#111!important}
.profile-card.in-panel .profile-cover{height:110px}
.profile-card.in-panel .profile-actions button{margin-top:0}

.room-create{background:#fff7ef;border:1px solid #ead2c2;border-radius:8px;padding:8px;margin:0 0 8px}.room-create input{height:36px;margin:4px 0}.room-create-actions{display:flex;gap:6px}.room-create-actions .mini-btn{flex:1;margin:0}


/* BA v26 settings panel like original classic chat */
.settings-classic-panel{direction:rtl;padding:0 2px 10px;background:#fff;font-weight:bold}.settings-classic-panel button,.settings-classic-panel label{font-family:Tahoma,Arial,sans-serif}.settings-line{width:100%;min-height:39px;margin:5px 0;border:1px solid #222;border-radius:6px;background:#fff;color:#222;display:flex;align-items:center;gap:8px;justify-content:center;font-size:16px;font-weight:bold;cursor:pointer;position:relative;overflow:hidden}.settings-line.white{background:#fff}.settings-line.red{background:#df5050;color:#fff;border-color:#df5050}.settings-line .ico{position:absolute;right:9px;font-size:22px}.settings-line .xico{font-size:28px;line-height:1}.settings-line .state-pill{position:absolute;left:8px;background:#25a945;color:#fff;border-radius:18px;padding:5px 12px;font-size:13px;box-shadow:inset 0 -2px 0 rgba(0,0,0,.18)}.file-line input[type=file]{display:none}.file-line img{position:absolute;right:7px;width:34px;height:34px;border-radius:4px;object-fit:cover}.settings-line .big-x{position:absolute;right:10px;font-size:42px;line-height:.7;color:#111}.settings-decor-card,.settings-frames-card{border:1px solid #aaa;background:#fff;margin:6px 0;min-height:60px;display:grid;grid-template-columns:54px 1fr;align-items:center;overflow:auto}.decor-remove{width:54px;height:58px;margin:0;border:0!important;background:#fff!important;color:#df5050!important;font-size:58px!important;line-height:.7!important;font-weight:900}.decor-preview{min-width:235px;text-align:center;font-size:18px;color:#111}.decor-preview b{color:#e3002b}.frame-list{display:flex;align-items:center;gap:9px;min-width:300px;padding:8px}.frame-list span{width:48px;height:48px;border-radius:50%;display:block;border:3px solid #e7ae76;background:radial-gradient(circle,transparent 54%,#e7ae76 56%,#f8f0e8 70%,transparent 72%);box-shadow:0 0 0 1px #eee inset}.frame-list span:nth-child(2){border-color:#9d4cff;background:radial-gradient(circle,transparent 54%,#9d4cff 56%,#f4e6ff 70%,transparent 72%)}.frame-list span:nth-child(3){border-color:#dd7d7d;background:radial-gradient(circle,transparent 54%,#dd7d7d 56%,#fff0f0 70%,transparent 72%)}.frame-list span:nth-child(4){border-color:#ffb400;background:radial-gradient(circle,transparent 54%,#ffb400 56%,#fff6d6 70%,transparent 72%)}.settings-section{width:100%;height:40px;border:0;border-radius:6px;margin:5px 0;color:#fff;font-weight:bold;font-size:16px;cursor:pointer;text-align:center;display:flex;align-items:center;justify-content:center;text-decoration:none}.settings-section.green{background:#25a945}.settings-section.purple{background:#a30060}.settings-section.orange{background:#ffa200;color:#fff}.settings-section.violet{background:#d866f0;color:#fff}.settings-section.red{background:#df5050}.settings-classic-panel *{touch-action:manipulation}

.settings-action-box{border:1px solid #ddd;background:#fff;padding:8px;margin:6px 0;border-radius:6px;box-shadow:inset 0 0 12px rgba(0,0,0,.06)}
.settings-action-box input{width:100%;box-sizing:border-box;height:35px;margin:4px 0;border:1px solid #bbb;border-radius:5px;padding:0 10px;font-weight:bold;direction:rtl}
.settings-action-box .mini-btn{height:34px;margin:4px;border:0;border-radius:6px;background:#a9001f;color:#fff;font-weight:bold;padding:0 12px;cursor:pointer}
.settings-action-box .mini-btn.light{background:#eee;color:#111}
.frame-list span{cursor:pointer}.frame-list span.selected{outline:4px solid #14a6ff;outline-offset:2px}
.settings-admin-link:visited,.settings-admin-link:hover{color:#fff;text-decoration:none}

/* v33 - إظهار الفيسات والهدايا المضافة داخل صندوق الابتسامات */
.media-picker{
  position:fixed;
  left:6px;
  bottom:82px;
  width:310px;
  max-width:calc(100vw - 20px);
  max-height:330px;
  overflow:auto;
  background:#fff;
  border:1px solid #777;
  border-radius:8px;
  box-shadow:0 10px 35px rgba(0,0,0,.35);
  z-index:2147483000;
  direction:rtl;
  padding:6px;
}
.media-picker-title{
  background:var(--main,#a9001f);
  color:#fff;
  font-weight:bold;
  text-align:center;
  border-radius:6px;
  padding:5px;
  margin-bottom:5px;
}
.media-section-title{
  font-weight:bold;
  color:#a9001f;
  border-top:1px solid #ddd;
  margin-top:6px;
  padding:5px 3px;
}
.media-grid{
  display:flex;
  flex-wrap:wrap;
  gap:3px;
  align-items:center;
}
.media-emoji,
.media-img-btn{
  width:32px;
  height:32px;
  border:1px solid #ddd;
  background:#fff;
  border-radius:5px;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0;
  font-size:22px;
}
.media-img-btn img{
  max-width:28px;
  max-height:28px;
  object-fit:contain;
  display:block;
}
.media-empty{
  padding:12px;
  text-align:center;
  color:#777;
  font-weight:bold;
}
.chat-inline-media{
  max-width:42px;
  max-height:42px;
  vertical-align:middle;
  object-fit:contain;
  margin:0 2px;
}
.wall-post .chat-inline-media{
  max-width:56px;
  max-height:56px;
}
.pm-msg .chat-inline-media{
  max-width:44px;
  max-height:44px;
}


/* BA v37 - Classic outside landing page */
.classic-home-page{
  min-height:100vh;
  margin:0;
  background:#fff;
  font-family:Tahoma,Arial,sans-serif;
  direction:rtl;
  overflow:auto;
}
.classic-home-box{
  width:590px;
  max-width:calc(100vw - 14px);
  margin:0 auto;
  border:1px solid #111;
  background:#fff;
  min-height:100vh;
  box-shadow:0 0 0 1px #ddd inset;
}
.classic-home-head{
  height:42px;
  background:var(--main,#8a000d);
  color:#fff;
  display:flex;
  align-items:center;
  gap:8px;
  padding:0 6px;
  position:relative;
}
.home-logo{
  width:38px;
  height:38px;
  border-radius:3px;
  overflow:hidden;
  background:#fff;
  flex:0 0 auto;
}
.home-logo img{
  width:100%;
  height:100%;
  object-fit:cover;
}
.home-title{
  font-weight:bold;
  font-size:17px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  flex:1;
  text-align:right;
}
.home-refresh{
  width:36px;
  height:36px;
  border:0;
  border-radius:7px;
  background:#26a84a;
  color:#fff;
  font-size:23px;
  font-weight:bold;
  cursor:pointer;
}
.home-banner{
  min-height:250px;
  background:#f8efe2;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  border-bottom:1px solid #e5d9c6;
}
.home-banner img{
  width:100%;
  height:auto;
  display:block;
}
.home-banner-fallback{
  width:100%;
  min-height:250px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  background:linear-gradient(135deg,#fff7e8,#ead6b8);
  color:var(--main,#8a000d);
  text-align:center;
}
.home-banner-fallback b{
  font-size:42px;
  margin-bottom:12px;
}
.home-banner-fallback span{
  font-size:19px;
  color:#6b4a34;
}
.home-links{
  height:43px;
  background:#fff;
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:7px;
  padding:6px;
  border-bottom:1px solid #ddd;
}
.home-links a{
  background:var(--main,#8a000d);
  color:#fff;
  border-radius:16px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:bold;
  text-decoration:none;
  font-size:14px;
}
.home-ticker{
  height:29px;
  line-height:29px;
  font-weight:bold;
  border-top:1px solid #222;
  border-bottom:1px solid #222;
  overflow:hidden;
}
.home-tabs{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  background:#f3f3f3;
  border-bottom:1px solid #ddd;
}
.home-tabs button{
  height:48px;
  border:0;
  border-left:1px solid #ddd;
  background:#f7f7f7;
  color:#1a5c9e;
  font-weight:bold;
  font-size:16px;
  cursor:pointer;
}
.home-tabs button.active{
  background:#fff;
  color:#177bc2;
  border-top:3px solid var(--main,#8a000d);
}
.home-forms{
  padding:12px;
  background:#fff;
  border-bottom:1px solid #ddd;
}
.home-form{
  display:grid;
  grid-template-columns:1fr 1fr auto auto;
  gap:8px;
  align-items:center;
}
.home-form input[type=text],
.home-form input[type=password],
.home-form input:not([type]){
  height:35px;
  border:1px solid #333;
  border-radius:6px;
  padding:5px 8px;
  font-weight:bold;
  font-size:15px;
}
.home-check{
  display:flex;
  align-items:center;
  gap:5px;
  white-space:nowrap;
  font-weight:bold;
}
.home-check input{
  width:18px;
  height:18px;
}
.home-login-btn{
  height:38px;
  border:0;
  border-radius:9px;
  background:var(--main,#8a000d);
  color:#fff;
  font-weight:bold;
  min-width:58px;
  cursor:pointer;
}
.home-owner-line{
  text-align:left;
  color:#0077d9;
  font-size:12px;
  padding:0 8px 6px;
  font-weight:bold;
}
.home-alert{
  margin:8px;
  background:#ffe5e5;
  color:#9a0000;
  border:1px solid #ffb5b5;
  border-radius:6px;
  padding:8px;
  font-weight:bold;
  text-align:center;
}
.online-title{
  height:38px;
  background:var(--main,#8a000d);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  font-weight:bold;
  border-top:1px solid #fff;
}
.online-title b{
  background:#43bf64;
  color:#fff;
  border-radius:8px;
  padding:3px 16px;
  font-size:19px;
}
.online-list{
  max-height:420px;
  overflow-y:auto;
  background:#fff;
}
.online-home-user{
  min-height:92px;
  display:grid;
  grid-template-columns:78px 1fr;
  gap:10px;
  padding:10px 12px;
  border-bottom:1px solid #333;
  align-items:center;
  direction:ltr;
}
.online-home-user img{
  width:68px;
  height:68px;
  border-radius:50%;
  object-fit:cover;
  background:#f3f3f3;
}
.online-home-info{
  direction:rtl;
  text-align:right;
}
.online-home-name{
  font-size:18px;
  font-weight:bold;
  color:#06004b;
}
.online-home-rank{
  color:#777;
  font-size:12px;
  margin-top:3px;
}
.online-home-status{
  color:#555;
  font-size:16px;
  margin-top:7px;
}
.online-empty{
  padding:35px;
  text-align:center;
  color:#777;
  font-weight:bold;
}
@media(max-width:640px){
  .classic-home-box{
    width:100%;
    max-width:100%;
    border-left:0;
    border-right:0;
  }
  .home-banner{min-height:190px}
  .home-banner-fallback{min-height:190px}
  .home-form{
    grid-template-columns:1fr;
  }
  .home-tabs button{
    font-size:14px;
  }
  .home-links a{
    font-size:12px;
  }
}

/* BA v39 - panels from left side مثل طلبك */
.side-panel{
  left:8px!important;
  right:auto!important;
}
@media(max-width:700px){
  .side-panel{
    left:4px!important;
    right:auto!important;
    width:calc(100vw - 8px)!important;
  }
}
.profile-modal,.profile-box,.profile-card{
  left:50%!important;
  right:auto!important;
  transform:translateX(-50%)!important;
}
.pm-window,.private-window,.wall-window,.rooms-window,.settings-window{
  left:8px!important;
  right:auto!important;
}


/* BA v40 - اتجاه المحادثات فقط، النوافذ تبقى من اليمين */
.side-panel{
  right:8px!important;
  left:auto!important;
}
@media(max-width:700px){
  .side-panel{
    right:4px!important;
    left:auto!important;
    width:calc(100vw - 8px)!important;
  }
}
.pm-window,.private-window,.wall-window,.rooms-window,.settings-window{
  right:8px!important;
  left:auto!important;
}
.chat-flow-right .messages{direction:rtl}
.chat-flow-right .msg{
  direction:rtl!important;
  grid-template-columns:72px 1fr 82px!important;
}
.chat-flow-right .msg .avatar{grid-column:1}
.chat-flow-right .msg .content{
  direction:rtl!important;
  text-align:right!important;
}
.chat-flow-right .msg .time{
  direction:rtl!important;
  text-align:center!important;
}
.chat-flow-left .messages{direction:ltr}
.chat-flow-left .msg{
  direction:ltr!important;
  grid-template-columns:82px 1fr 72px!important;
}
.chat-flow-left .msg .avatar{grid-column:1}
.chat-flow-left .msg .content{
  direction:rtl!important;
  text-align:left!important;
}
.chat-flow-left .msg .content .name{
  justify-content:flex-start!important;
}
.chat-flow-left .msg .text{
  direction:rtl!important;
  text-align:left!important;
}
.chat-flow-left .msg .time{
  direction:ltr!important;
  text-align:center!important;
}

/* BA v42 - تشغيل الصوت للمايكات */
.mic-seat.live::after{
  content:"";
  position:absolute;
  inset:1px;
  border-radius:50%;
  box-shadow:0 0 0 2px #26db5c inset, 0 0 10px #26db5c;
  pointer-events:none;
}
.mic-seat.mine::after{
  box-shadow:0 0 0 3px #ffe200 inset, 0 0 12px #ffe200;
}
.mic-status-text{
  color:#fff;
  font-size:12px;
  background:#0008;
  border-radius:9px;
  padding:3px 8px;
  white-space:nowrap;
  direction:rtl;
}
@media(max-width:720px){
  .mic-status-text{display:none}
}

/* BA v43 - mic audio fallback */
.mic-status-text{
  max-width:220px;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* BA v44 PCM mic */
.mic-seat.mine{animation:baMicPulse 1.1s infinite}
@keyframes baMicPulse{0%{filter:brightness(1)}50%{filter:brightness(1.25)}100%{filter:brightness(1)}}



/* BA v51 - شكل الجوال المضغوط مثل الشات الكلاسيكي */
@media(max-width:780px){
  html, body{height:100dvh!important;overflow:hidden!important}
  body.chat-page{background:#51535a!important}
  #app{height:100dvh!important;overflow:hidden!important}

  .topbar{
    height:58px!important;
    min-height:58px!important;
    padding:4px 3px!important;
    gap:4px!important;
    border-bottom:1px solid #2b2b2b!important;
  }
  .sound-btn{
    width:50px!important;
    height:50px!important;
    min-width:50px!important;
    font-size:24px!important;
  }
  .mic-seats{gap:4px!important;padding:0 2px!important}
  .mic-seat{
    min-width:48px!important;
    width:48px!important;
    height:48px!important;
    font-size:24px!important;
    border-width:2px!important;
  }
  .mic-seat img{width:44px!important;height:44px!important}
  .mic-seat small{font-size:8px!important;height:13px!important;line-height:13px!important}

  .ad-slot{
    min-height:42px!important;
    max-height:48px!important;
    padding:4px!important;
    overflow:hidden!important;
    background:#07111f!important;
    color:#ffe400!important;
    border:1px solid #e9c24a!important;
    border-radius:8px!important;
    margin:4px 4px!important;
    font-size:15px!important;
    font-weight:bold!important;
    line-height:34px!important;
    white-space:nowrap!important;
  }

  .chat-wrap{flex:1 1 auto!important;min-height:0!important;background:#51535a!important}
  .messages{
    padding:0!important;
    background:#51535a!important;
    overscroll-behavior:contain!important;
  }

  .msg,
  .chat-flow-right .msg,
  .chat-flow-left .msg{
    grid-template-columns:58px 1fr 48px!important;
    min-height:auto!important;
    gap:5px!important;
    padding:4px 3px!important;
    border-bottom:1px solid #d2d2d2!important;
    background:#fff3e8!important;
    align-items:start!important;
  }
  .msg:nth-child(even){background:#e1e1e1!important}
  .msg.system,.msg.notice{background:#d9d9d9!important}

  .msg .avatar{
    width:54px!important;
    height:54px!important;
    border-radius:2px!important;
  }
  .msg .content{min-width:0!important}
  .msg .name{
    font-size:15px!important;
    line-height:1.25!important;
    margin:0 0 2px!important;
    gap:3px!important;
    max-width:100%!important;
  }
  .msg .namepill{
    padding:1px 6px!important;
    border-radius:5px!important;
  }
  .msg .ranktag{
    font-size:13px!important;
    padding:3px 5px!important;
    border-radius:4px!important;
    margin-inline-start:2px!important;
  }
  .msg .text{
    font-size:15px!important;
    line-height:1.45!important;
    margin:0!important;
    font-weight:600!important;
  }
  .msg .time{
    font-size:11px!important;
    line-height:1.25!important;
    padding-top:2px!important;
    text-align:center!important;
  }
  .msg .del{
    font-size:10px!important;
    padding:1px 6px!important;
    margin-top:3px!important;
  }

  .sendbar{
    height:43px!important;
    min-height:43px!important;
    padding:3px!important;
    gap:4px!important;
    border-top:1px solid #cfcfcf!important;
  }
  .sendbar input{
    height:35px!important;
    font-size:14px!important;
    padding:5px 10px!important;
    border-radius:18px!important;
  }
  .round{
    width:36px!important;
    height:36px!important;
    min-width:36px!important;
    font-size:18px!important;
  }
  .send{
    width:43px!important;
    min-width:43px!important;
    height:38px!important;
    font-size:23px!important;
  }

  .bottom-nav{
    height:43px!important;
    min-height:43px!important;
    background:#050505!important;
    border-top:1px solid #222!important;
    overflow:hidden!important;
    direction:rtl!important;
  }
  .bottom-nav button,.bottom-nav a{
    min-width:0!important;
    height:43px!important;
    font-size:12px!important;
    padding:0 2px!important;
    border-left:1px solid #2b2b2b!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    flex:1 1 0!important;
  }
  .bottom-nav .users-count{
    flex:0 0 42px!important;
    min-width:42px!important;
    border-radius:0!important;
  }
  .bottom-nav [data-panel="favorites"]{
    flex:0 0 38px!important;
    min-width:38px!important;
    font-size:18px!important;
  }
  .bottom-nav a[href*="admin"]{
    flex:0 0 58px!important;
    min-width:58px!important;
  }

  .side-panel{
    right:4px!important;
    left:4px!important;
    width:auto!important;
    top:62px!important;
    bottom:88px!important;
    border-width:3px!important;
    border-radius:8px!important;
    z-index:2147482000!important;
  }
  .side-panel-head{height:42px!important}
  .panel-tab{height:37px!important;min-width:170px!important;font-size:15px!important}
  .panel-close{width:32px!important;height:32px!important;font-size:25px!important}
  .panel-body{padding:5px!important}

  .wall-post,.pm-msg,.room-card,.member-card{
    font-size:14px!important;
  }
}

/* لا تخفي حالة المايك في الجوال لأننا نحتاج نعرف هل يلتقط الصوت */
@media(max-width:720px){
  .mic-status-text{
    display:block!important;
    position:absolute!important;
    left:56px!important;
    top:4px!important;
    max-width:180px!important;
    font-size:10px!important;
    z-index:5!important;
    background:#000a!important;
  }
}


/* BA v52 mic status stronger */
.mic-status-text{
  background:#000c!important;
  color:#fff!important;
  border:1px solid #ffd34d!important;
  border-radius:8px!important;
  padding:4px 8px!important;
  font-weight:bold!important;
}
@media(max-width:780px){
  .mic-status-text{
    display:block!important;
    position:absolute!important;
    left:58px!important;
    top:3px!important;
    max-width:220px!important;
    font-size:10px!important;
    line-height:1.35!important;
    z-index:20!important;
  }
}

/* BA v53 mic status */
.mic-status-text{display:block!important;background:#000!important;color:#fff!important;border:1px solid #ffd700!important;border-radius:8px!important;padding:4px 8px!important;font-weight:bold!important;z-index:999999!important}

/* BA v54 mic clear note */
.mic-status-text{
  letter-spacing:0!important;
  text-shadow:none!important;
}

/* BA v55 anti cut */
.mic-status-text{max-width:260px!important}


/* BA v56 - classic left chat layout */
.messages{
  direction:ltr;
}
.msg{
  display:flex !important;
  flex-direction:row !important;
  align-items:flex-start !important;
  gap:10px !important;
  min-height:78px;
  padding:7px 8px !important;
  direction:ltr !important;
}
.msg .avatar{
  order:1;
  flex:0 0 74px;
  width:74px;
  height:64px;
  margin:0 !important;
}
.msg .content{
  order:2;
  flex:1 1 auto;
  min-width:0;
  direction:rtl;
  text-align:right;
  align-self:center;
}
.msg .time{
  order:3;
  flex:0 0 72px;
  width:72px;
  text-align:right !important;
  direction:rtl !important;
  padding-top:6px;
  white-space:nowrap;
  margin-inline-start:auto;
}
.msg .name{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:flex-start;
  gap:4px;
}
.msg .text{
  display:block;
  width:100%;
}
.msg .del{
  display:inline-block;
}
@media (max-width: 768px){
  .msg{
    gap:7px !important;
    padding:6px 5px !important;
  }
  .msg .avatar{
    flex:0 0 58px;
    width:58px;
    height:58px;
  }
  .msg .time{
    flex:0 0 48px;
    width:48px;
    font-size:12px;
  }
  .msg .name{font-size:15px}
  .msg .ranktag{font-size:12px;padding:3px 6px}
  .msg .text{font-size:15px;line-height:1.55}
}


/* BA v57 - الرسائل العامة مثل الشات الكلاسيكي: الصورة يسار، النص بعدها، الوقت يمين */
body.chat-page #messages.messages{
  direction:ltr !important;
}
body.chat-page #messages .msg,
body.chat-page #messages .msg.chat,
body.chat-page #messages .msg.system,
body.chat-page #messages .msg.notice{
  display:grid !important;
  grid-template-columns:74px minmax(0,1fr) 72px !important;
  grid-template-areas:"avatar content time" !important;
  direction:ltr !important;
  text-align:left !important;
  gap:8px !important;
  align-items:start !important;
}
body.chat-page #messages .msg .avatar{
  grid-area:avatar !important;
  order:0 !important;
  margin:0 !important;
  justify-self:start !important;
}
body.chat-page #messages .msg .content{
  grid-area:content !important;
  order:0 !important;
  direction:rtl !important;
  text-align:right !important;
  justify-self:stretch !important;
  width:100% !important;
  min-width:0 !important;
}
body.chat-page #messages .msg .time{
  grid-area:time !important;
  order:0 !important;
  direction:rtl !important;
  text-align:right !important;
  justify-self:end !important;
  width:72px !important;
  margin:0 !important;
}
body.chat-page #messages .msg .name{
  direction:rtl !important;
  text-align:right !important;
  justify-content:flex-start !important;
}
body.chat-page #messages .msg .text{
  direction:rtl !important;
  text-align:right !important;
}

@media(max-width:780px){
  body.chat-page #messages .msg,
  body.chat-page #messages .msg.chat,
  body.chat-page #messages .msg.system,
  body.chat-page #messages .msg.notice{
    grid-template-columns:58px minmax(0,1fr) 48px !important;
    grid-template-areas:"avatar content time" !important;
    gap:6px !important;
    padding:6px 5px !important;
  }
  body.chat-page #messages .msg .avatar{
    width:58px !important;
    height:58px !important;
  }
  body.chat-page #messages .msg .time{
    width:48px !important;
    font-size:12px !important;
    text-align:right !important;
  }
}


/* BA v58 - forced left layout fallback */
#messages{direction:ltr!important}
#messages .ba-left-message{
  display:flex!important;
  flex-direction:row!important;
  direction:ltr!important;
  text-align:left!important;
  align-items:flex-start!important;
}
#messages .ba-left-message>.avatar{order:1!important}
#messages .ba-left-message>.content{order:2!important;direction:rtl!important;text-align:right!important}
#messages .ba-left-message>.time{order:3!important;direction:rtl!important;text-align:right!important}


/* BA v59 - classic left message layout + profile gifts */
#messages{direction:ltr!important}
#messages .ba-classic-left-message{display:flex!important;flex-direction:row!important;direction:ltr!important;text-align:left!important;align-items:flex-start!important;gap:8px!important;width:100%!important}
#messages .ba-classic-left-message>.avatar{order:1!important;flex:0 0 74px!important;width:74px!important;height:64px!important;margin:0!important}
#messages .ba-classic-left-message>.content{order:2!important;flex:1 1 auto!important;min-width:0!important;direction:rtl!important;text-align:right!important}
#messages .ba-classic-left-message>.time{order:3!important;flex:0 0 72px!important;width:72px!important;direction:rtl!important;text-align:right!important;margin:0!important}
.profile-gift-picker{background:#fff;border-bottom:1px solid #ddd;padding:8px;direction:rtl;text-align:center;max-height:210px;overflow:auto}
.profile-gift-title{background:#8b000e;color:#fff;border-radius:6px;padding:5px 10px;margin-bottom:7px;font-weight:bold;display:inline-block}
.profile-gift-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(54px,1fr));gap:6px;align-items:start}
.profile-gift-item{border:1px solid #ddd;background:#fff;border-radius:6px;padding:3px;min-height:54px;cursor:pointer;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px}
.profile-gift-item:hover{border-color:#a9001f;background:#fff6f6}
.profile-gift-item img{max-width:42px;max-height:42px;object-fit:contain;display:block}
.profile-gift-item span{font-size:10px;line-height:1.1;max-width:48px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.profile-gift-empty{grid-column:1/-1;padding:14px;font-weight:bold;color:#a9001f}
@media(max-width:780px){
 #messages .ba-classic-left-message{gap:6px!important;padding:6px 5px!important}
 #messages .ba-classic-left-message>.avatar{flex-basis:58px!important;width:58px!important;height:58px!important}
 #messages .ba-classic-left-message>.time{flex-basis:48px!important;width:48px!important;font-size:12px!important}
 .profile-gift-picker{max-height:180px}.profile-gift-grid{grid-template-columns:repeat(auto-fill,minmax(48px,1fr))}
}


/* BA v60 - FINAL classic messages from left + clean gift picker */
body.chat-page #messages{direction:ltr!important}
body.chat-page #messages .msg,
body.chat-page #messages .ba-classic-left-message{
  display:flex!important;
  flex-direction:row!important;
  direction:ltr!important;
  text-align:left!important;
  align-items:flex-start!important;
  gap:8px!important;
  width:100%!important;
  box-sizing:border-box!important;
}
body.chat-page #messages .msg>.avatar,
body.chat-page #messages .ba-classic-left-message>.avatar{
  order:1!important;
  flex:0 0 74px!important;
  width:74px!important;
  height:64px!important;
  margin:0!important;
  align-self:flex-start!important;
}
body.chat-page #messages .msg>.content,
body.chat-page #messages .ba-classic-left-message>.content{
  order:2!important;
  flex:1 1 auto!important;
  min-width:0!important;
  width:auto!important;
  direction:ltr!important;
  text-align:left!important;
  align-self:center!important;
}
body.chat-page #messages .msg>.content .name,
body.chat-page #messages .ba-classic-left-message>.content .name{
  direction:ltr!important;
  text-align:left!important;
  justify-content:flex-start!important;
}
body.chat-page #messages .msg>.content .text,
body.chat-page #messages .ba-classic-left-message>.content .text{
  direction:rtl!important;
  text-align:left!important;
  unicode-bidi:plaintext!important;
}
body.chat-page #messages .msg>.time,
body.chat-page #messages .ba-classic-left-message>.time{
  order:3!important;
  flex:0 0 72px!important;
  width:72px!important;
  margin:0!important;
  direction:rtl!important;
  text-align:center!important;
  align-self:flex-start!important;
}
.profile-card.gift-open .profile-avatar{display:none!important}
.profile-card.gift-open .profile-top{grid-template-columns:1fr 120px!important;min-height:auto!important;padding-top:10px!important}
.profile-card.gift-open .profile-info{text-align:center!important}
.profile-card.gift-open .profile-gift-picker{position:relative!important;z-index:50!important;background:#fff!important;border-top:1px solid #ddd!important;border-bottom:1px solid #ddd!important;margin:0!important;padding:8px!important;max-height:245px!important;overflow:auto!important;box-shadow:0 2px 9px #0001!important}
.profile-card.gift-open .profile-gift-grid{display:grid!important;grid-template-columns:repeat(auto-fill,minmax(46px,1fr))!important;gap:5px!important;align-items:start!important}
.profile-card.gift-open .profile-gift-item{height:45px!important;min-height:45px!important;padding:2px!important;overflow:hidden!important}
.profile-card.gift-open .profile-gift-item img{max-width:38px!important;max-height:38px!important;object-fit:contain!important}
.profile-card.gift-open .profile-gift-item span{display:none!important}
.profile-gift-actions{display:flex;justify-content:space-between;gap:8px;margin-top:7px}
.profile-gift-actions button{background:#8b000e;color:#fff;border:0;border-radius:6px;padding:7px 10px;font-weight:bold;cursor:pointer}
@media(max-width:780px){
  body.chat-page #messages .msg,
  body.chat-page #messages .ba-classic-left-message{gap:6px!important;padding:6px 5px!important}
  body.chat-page #messages .msg>.avatar,
  body.chat-page #messages .ba-classic-left-message>.avatar{flex-basis:58px!important;width:58px!important;height:58px!important}
  body.chat-page #messages .msg>.time,
  body.chat-page #messages .ba-classic-left-message>.time{flex-basis:48px!important;width:48px!important;font-size:12px!important}
  .profile-card.gift-open .profile-top{grid-template-columns:1fr 92px!important}
  .profile-card.gift-open .profile-gift-picker{max-height:220px!important}
}


/* BA v61 - كل واجهات الشات تبدأ من اليسار مع بقاء النص العربي واضح */
html[dir="ltr"] body.chat-page,
body.chat-page,
body.chat-page #app{
  direction:ltr !important;
}
body.chat-page input,
body.chat-page textarea,
body.chat-page select{
  direction:ltr !important;
  text-align:left !important;
}
body.chat-page input::placeholder,
body.chat-page textarea::placeholder{
  text-align:left !important;
}

/* الرسائل العامة */
body.chat-page #messages.messages{direction:ltr!important;text-align:left!important;}
body.chat-page #messages .msg{
  direction:ltr!important;
  text-align:left!important;
}
body.chat-page #messages .msg .avatar{justify-self:start!important;}
body.chat-page #messages .msg .content,
body.chat-page #messages .msg .name,
body.chat-page #messages .msg .text{
  direction:ltr!important;
  text-align:left!important;
  justify-content:flex-start!important;
}
body.chat-page #messages .msg .time{
  direction:ltr!important;
  text-align:right!important;
}

/* القوائم الجانبية: الحائط، الخاص، الغرف، الأعضاء، الإعدادات */
.side-panel,
.side-panel *{
  direction:ltr !important;
}
.panel-title,
.panel-tab,
.panel-body{
  text-align:left!important;
}
.panel-close{
  right:8px!important;
  left:auto!important;
}
.classic-search,
.wall-sendbar,
.pm-send,
.room-create-actions,
.profile-control,
.settings-line,
.settings-section,
.settings-action-box,
.settings-decor-card,
.settings-frames-card{
  direction:ltr!important;
  text-align:left!important;
}
.classic-search{
  flex-direction:row!important;
}
.classic-search input,
.wall-sendbar input,
.pm-send input,
.room-create input{
  direction:ltr!important;
  text-align:left!important;
}

/* الحائط من اليسار */
#wallPosts,
.wall-post{
  direction:ltr!important;
  text-align:left!important;
}
.wall-post-head{
  direction:ltr!important;
  text-align:left!important;
  display:flex!important;
  flex-direction:row!important;
  align-items:flex-start!important;
  gap:8px!important;
}
.wall-post-head img{
  order:1!important;
  margin:0!important;
}
.wall-post-head > div{
  order:2!important;
  flex:1 1 auto!important;
  min-width:0!important;
  direction:ltr!important;
  text-align:left!important;
}
.wall-post-head > div span,
.wall-post-head > div p{
  direction:ltr!important;
  text-align:left!important;
}
.wall-post-head .meta{
  order:3!important;
  margin-left:auto!important;
  margin-right:0!important;
  direction:ltr!important;
  text-align:right!important;
}
.wall-actions{
  direction:ltr!important;
  justify-content:flex-start!important;
  text-align:left!important;
}
.delete-x{
  left:8px!important;
  right:auto!important;
}

/* الغرف من اليسار */
#roomsBox,
#roomsList,
.room-card{
  direction:ltr!important;
  text-align:left!important;
}
.room-card{
  grid-template-columns:64px minmax(0,1fr) 50px!important;
}
.room-card img{
  margin-left:4px!important;
  margin-right:0!important;
  justify-self:start!important;
}
.room-card b,
.room-card .desc{
  direction:ltr!important;
  text-align:left!important;
}
.room-stats{
  direction:ltr!important;
  justify-self:end!important;
}

/* الأعضاء والخاص من اليسار */
.pm-users,
.pm-empty,
#pmArea,
.pm-box,
.pm-msg,
.list-item,
.member-card,
.member-strip{
  direction:ltr!important;
  text-align:left!important;
}
.pm-msg,
.pm-msg.mine{
  margin-left:0!important;
  margin-right:auto!important;
  text-align:left!important;
  direction:ltr!important;
}
.list-item{
  flex-direction:row!important;
}
.list-item .meta,
.member-card .username,
.member-card .status,
.member-card .rankno{
  direction:ltr!important;
  text-align:left!important;
}
.member-card{
  grid-template-columns:62px minmax(0,1fr) 54px!important;
}
.member-card img{justify-self:start!important;}
.member-card .rankno{justify-self:end!important;}

/* الإعدادات داخل الشات من اليسار */
.settings-classic-panel,
.settings-classic-panel *{
  direction:ltr!important;
  text-align:left!important;
}
.settings-line,
.settings-section{
  justify-content:flex-start!important;
}
.settings-line .state-pill{
  margin-left:auto!important;
  margin-right:0!important;
}
.settings-line .ico,
.settings-line img,
.settings-line .big-x{
  margin-left:0!important;
  margin-right:8px!important;
}
.color-row,
.color-palette,
.frame-list,
.decor-list{
  direction:ltr!important;
  text-align:left!important;
  justify-content:flex-start!important;
}

/* الملف الشخصي وقائمة الهدايا من اليسار */
.profile-card,
.profile-card *{
  direction:ltr!important;
  text-align:left!important;
}
.profile-close{
  left:auto!important;
  right:8px!important;
}
.profile-top{
  flex-direction:row!important;
  justify-content:flex-start!important;
}
.profile-room-tag{
  margin-left:auto!important;
  margin-right:0!important;
}
.profile-actions,
.profile-admin-lines,
.profile-control{
  direction:ltr!important;
  text-align:left!important;
}
.profile-gift-picker,
.profile-gift-grid,
.profile-gift-picker *{
  direction:ltr!important;
  text-align:left!important;
}

@media(max-width:780px){
  .side-panel{right:4px!important;left:4px!important;width:auto!important;}
  .room-card{grid-template-columns:58px minmax(0,1fr) 46px!important;}
}


/* BA v65 - فيسات الحائط + رفع صور وفيديو */
.upload-round{
  border-color:#111!important;
  background:#fff!important;
  font-size:18px!important;
}
.side-panel .media-picker.in-wall-panel{
  position:absolute!important;
  left:8px!important;
  right:8px!important;
  bottom:48px!important;
  width:auto!important;
  max-width:none!important;
  max-height:285px!important;
  z-index:2147483100!important;
}
.chat-inline-video{
  display:block;
  width:min(260px, 92vw);
  max-width:100%;
  max-height:240px;
  margin:6px 0;
  border-radius:8px;
  background:#000;
}
.wall-post .chat-inline-video{
  width:100%;
  max-height:260px;
}
.wall-sendbar #wallShare{
  min-width:36px;
  font-size:18px;
}
@media(max-width:780px){
  .side-panel .media-picker.in-wall-panel{
    left:5px!important;
    right:5px!important;
    bottom:46px!important;
    max-height:260px!important;
  }
  .chat-inline-video{
    width:100%;
    max-height:210px;
  }
}


/* BA v66 - إخفاء آمن لحقل رفع ملف الحائط */
#wallFile.ba-file-hidden,
#wallFile.hidden,
#mediaUploadFile.hidden{
  position:absolute!important;
  width:1px!important;
  height:1px!important;
  opacity:0!important;
  overflow:hidden!important;
  pointer-events:none!important;
  left:-9999px!important;
}


/* BA v67 - المنشن على أسماء الأعضاء */
.mention-name,
.namepill[data-mention-name],
.wall-post [data-mention-name]{
  cursor:pointer!important;
}
.mention-name:hover .namepill,
.namepill[data-mention-name]:hover,
.wall-post [data-mention-name]:hover{
  text-decoration:underline!important;
}
.mention-tag{
  display:inline-block;
  background:rgba(0,128,255,.12);
  border:1px solid rgba(0,128,255,.25);
  color:#0056b3;
  border-radius:7px;
  padding:1px 5px;
  font-weight:bold;
  direction:ltr;
}


/* BA v69 - تخفيف الجوال */
.msg{
  contain: layout paint;
}
.chat-inline-media,
.profile-gift-item img,
.media-img-btn img{
  content-visibility:auto;
}
@media(max-width:780px){
  .msg .avatar{
    width:56px!important;
    height:52px!important;
    flex-basis:56px!important;
  }
  .msg{
    min-height:auto!important;
  }
  .chat-inline-media{
    max-width:180px!important;
    max-height:170px!important;
  }
  .profile-gift-grid,
  .uploaded-media-grid{
    overscroll-behavior:contain;
  }
}


/* BA v90 - country flags */
.member-country-flag{
    display:inline-block;
    font-size:18px;
    line-height:1;
    vertical-align:middle;
    margin-inline-end:4px;
}
.online-home-flag{
    font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif;
}


/* BA v91 - أعلام صور حقيقية بدل رموز OM/SA */
.member-country-flag{
    display:inline-block!important;
    width:24px!important;
    height:16px!important;
    object-fit:cover!important;
    vertical-align:middle!important;
    margin-inline-end:5px!important;
    border:1px solid rgba(0,0,0,.18)!important;
    border-radius:1px!important;
    box-shadow:0 1px 1px rgba(0,0,0,.12)!important;
}


/* BA v92 - أعلام صغيرة مثل الشات المرجعي */
.member-card img.member-country-flag{
    display:inline-block!important;
    width:18px!important;
    height:12px!important;
    min-width:18px!important;
    min-height:12px!important;
    max-width:18px!important;
    max-height:12px!important;
    border-radius:1px!important;
    object-fit:cover!important;
    vertical-align:middle!important;
    margin:0 4px!important;
    padding:0!important;
    border:1px solid rgba(0,0,0,.14)!important;
    box-shadow:none!important;
    background:transparent!important;
}


/* BA v94 - إظهار خلفية الغرفة مع الحفاظ على تنسيق الرسائل الأصلي */
body.chat-page #messages.messages{background-color:rgba(255,255,255,.10)!important;background-blend-mode:normal!important;}
body.chat-page #messages.messages .msg{background:rgba(255,241,231,.46)!important;}
body.chat-page #messages.messages .msg:nth-child(even){background:rgba(232,232,232,.38)!important;}
body.chat-page #messages.messages .msg.system,
body.chat-page #messages.messages .msg.notice{background:rgba(215,215,215,.52)!important;}
body.chat-page #messages.messages .msg .text{background:transparent!important;padding:0!important;margin-top:0!important;border:0!important;border-radius:0!important;box-shadow:none!important;}
body.chat-page #messages.messages .msg .name{background:transparent!important;padding:0!important;box-shadow:none!important;border-radius:0!important;}

/* BA v95 - لوحات الغرف والمتواجدين والحائط بيضاء دائمًا ولا تتأثر بخلفية الغرفة */
.side-panel,
.side-panel .panel-body,
.side-panel #roomsBox,
.side-panel #roomsList,
.side-panel #usersBox,
.side-panel #wallPosts {
  background:#fff !important;
  background-image:none !important;
}
.side-panel .room-card,
.side-panel .member-card,
.side-panel .list-item,
.side-panel .wall-post {
  background-color:#fff !important;
}
