:root{--primary:#075ea8;--accent:#1f8fff;--danger:#ef4136;--success:#12b76a;--bg:#eef1f4;--surface:#ffffff;--line:#e3e7ec;--text:#172033;--text-2:#475467;--muted:#8a96a8;--header-h:60px;--tabs-h:48px;--input-h:64px;--safe-bottom:env(safe-area-inset-bottom,0px)}*{box-sizing:border-box}html{height:100%}body{min-height:100%;margin:0;font-family:Vazirmatn,IRANYekan,Tahoma,system-ui,sans-serif;background:var(--bg);color:var(--text);-webkit-tap-highlight-color:transparent;overscroll-behavior-y:contain}button,input,textarea{font:inherit}button{border:0;cursor:pointer;background:0 0}.hidden{display:none!important}.chat-app-header{position:fixed;top:0;left:0;right:0;height:var(--header-h);z-index:120;display:flex;align-items:center;justify-content:space-between;padding:0 14px;background:linear-gradient(135deg,#064f8f,#0869b7 60%,#168be1);color:#fff;box-shadow:0 8px 22px rgba(5,65,120,.16)}.chat-header-title{font-size:17px;font-weight:900}.chat-header-back{width:36px;height:36px;border-radius:11px;display:flex;align-items:center;justify-content:center;background:rgba(255,255,255,.14);color:#fff}.chat-header-actions{display:flex;align-items:center;gap:8px}.chat-icon-btn{width:36px;height:36px;border-radius:11px;display:flex;align-items:center;justify-content:center;background:rgba(255,255,255,.14);color:#fff;transition:background .15s}.chat-icon-btn:hover{background:rgba(255,255,255,.24)}.chat-icon-btn svg{width:19px;height:19px}.chat-tabs{position:fixed;top:var(--header-h);left:0;right:0;height:var(--tabs-h);z-index:110;display:flex;background:var(--surface);border-bottom:1px solid var(--line)}.chat-tab{flex:1;display:flex;align-items:center;justify-content:center;gap:6px;font-size:12.5px;font-weight:800;color:var(--muted);position:relative;transition:color .15s}.chat-tab.active{color:var(--primary)}.chat-tab.active::after{content:"";position:absolute;bottom:0;left:18%;right:18%;height:3px;border-radius:3px 3px 0 0;background:var(--primary)}.chat-tab-badge{min-width:17px;height:17px;padding:0 4px;border-radius:999px;background:var(--danger);color:#fff;font-size:10px;font-weight:900;display:flex;align-items:center;justify-content:center}.chat-list-wrap{padding:calc(var(--header-h) + var(--tabs-h) + 10px) 0 24px;min-height:100vh}.chat-list-wrap.blurred{filter:blur(4px) brightness(.85);pointer-events:none;filter:brightness(.8)!important}.chat-card{display:flex;align-items:center;gap:12px;padding:12px 14px;background:var(--surface);border-bottom:1px solid var(--line);cursor:pointer;user-select:none;-webkit-user-select:none}.chat-card:active{background:#f5f8fb}.chat-avatar{flex:0 0 46px;width:46px;height:46px;border-radius:50%;background:linear-gradient(135deg,#dbeaff,#c7dcf5);display:flex;align-items:center;justify-content:center;color:var(--primary);font-size:19px;font-weight:900;overflow:hidden}.chat-avatar img{width:100%;height:100%;object-fit:cover}.chat-card-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}.chat-card-top{display:flex;align-items:center;justify-content:space-between;gap:8px}.chat-card-name{font-size:13.5px;font-weight:900;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.chat-card-time{flex:0 0 auto;font-size:10.5px;color:var(--muted)}.chat-card-ad{font-size:11px;color:var(--accent);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.chat-card-bottom{display:flex;align-items:center;justify-content:space-between;gap:8px}.chat-card-last{font-size:12px;color:var(--text-2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.chat-card-unread{flex:0 0 auto;min-width:19px;height:19px;padding:0 5px;border-radius:999px;background:var(--primary);color:#fff;font-size:10.5px;font-weight:900;display:flex;align-items:center;justify-content:center}.chat-empty{padding:70px 20px;text-align:center;color:var(--muted)}.chat-empty-icon{width:60px;height:60px;margin:0 auto 12px;border-radius:18px;background:#e6edf5;color:var(--primary);display:flex;align-items:center;justify-content:center;font-size:26px}.confirm-overlay{position:fixed;inset:0;z-index:400;display:flex;align-items:center;justify-content:center;padding:20px;background:rgba(10,20,35,.5);backdrop-filter:blur(6px)}.confirm-card{width:min(340px,100%);background:#fff;border-radius:22px;padding:26px 22px 20px;text-align:center;box-shadow:0 25px 60px rgba(16,27,45,.25)}.confirm-icon{width:56px;height:56px;margin:0 auto 14px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:26px}.confirm-icon.danger{background:#fdecea;color:var(--danger)}.confirm-title{font-size:15.5px;font-weight:900;margin:0 0 8px;color:var(--text)}.confirm-msg{font-size:12.5px;color:var(--text-2);line-height:1.9;margin:0 0 20px}.confirm-actions{display:flex;gap:9px}.confirm-btn{flex:1;min-height:44px;border-radius:13px;font-size:13px;font-weight:800}.confirm-btn.no{background:#f3f6fa;color:var(--text-2)}.confirm-btn.yes{background:linear-gradient(135deg,#ff6b6b,var(--danger));color:#fff}.sheet-overlay{position:fixed;inset:0;z-index:300;background:0 0}.sheet-overlay.hidden{display:none}.chat-sheet{position:fixed;left:0;right:0;bottom:0;z-index:310;height:34vh;min-height:230px;background:#fff;border-radius:24px 24px 0 0;box-shadow:0 -20px 55px rgba(0,0,0,.22);transform:translateY(100%);transition:transform .3s cubic-bezier(.2,.8,.2,1);padding:12px 16px calc(14px + var(--safe-bottom));display:flex;flex-direction:column}.chat-sheet.open{transform:translateY(0)}.chat-sheet-handle{width:38px;height:4px;margin:0 auto 10px;border-radius:99px;background:#e2e8f0;flex:0 0 auto}.chat-sheet-title{text-align:center;font-size:12.5px;font-weight:800;color:var(--muted);margin-bottom:10px;flex:0 0 auto}.chat-sheet-options{display:flex;flex-direction:column;gap:6px;overflow-y:auto}.sheet-option{display:flex;align-items:center;gap:12px;padding:13px 10px;border-radius:14px;font-size:13.5px;font-weight:800;color:var(--text)}.sheet-option:active{background:#f5f8fb}.sheet-option-icon{flex:0 0 40px;width:40px;height:40px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:18px}.sheet-option-icon.block{background:#fdecea;color:var(--danger)}.sheet-option-icon.delete{background:#fff4e6;color:#f79009}.sheet-option-icon.view{background:#e8f3ff;color:var(--primary)}.chat-settings-overlay{position:fixed;inset:0;z-index:400;display:flex;align-items:flex-end;justify-content:center;background:rgba(10,20,35,.5);backdrop-filter:blur(6px)}.chat-settings-overlay.hidden{display:none}.chat-settings-card{width:100%;max-width:520px;max-height:88vh;overflow-y:auto;background:#fff;border-radius:26px 26px 0 0;padding:22px}.chat-settings-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:18px}.chat-settings-head h3{margin:0;font-size:17px;font-weight:900}.chat-settings-x{width:34px;height:34px;border-radius:11px;background:#f3f6fa;color:var(--muted);display:flex;align-items:center;justify-content:center;font-size:20px}.chat-settings-label{display:block;font-size:12px;font-weight:800;color:var(--text-2);margin:0 0 7px}.chat-settings-input{width:100%;height:46px;border:1px solid var(--line);background:#f9fbfd;border-radius:13px;padding:0 14px;font-size:13px;color:var(--text);margin-bottom:20px}.chat-settings-input:focus{outline:0;border-color:var(--accent);background:#fff}.chat-settings-sub{font-size:12.5px;font-weight:900;color:var(--text);margin:0 0 10px}.blocked-list{display:flex;flex-direction:column;gap:8px;margin-bottom:22px}.blocked-empty{font-size:11.5px;color:var(--muted);padding:14px;text-align:center;background:#f7f9fb;border-radius:12px}.blocked-row{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 12px;border-radius:13px;background:#f7f9fb}.blocked-row-name{font-size:12.5px;font-weight:700;color:var(--text)}.blocked-row-remove{padding:7px 12px;border-radius:10px;background:#fdecea;color:var(--danger);font-size:11px;font-weight:800}.chat-settings-actions{display:flex;gap:9px}.chat-settings-actions .btn{flex:1;min-height:46px;border-radius:13px;font-size:13px;font-weight:900}.chat-settings-actions .btn.close{background:#f3f6fa;color:var(--text-2)}.chat-settings-actions .btn.ok{background:linear-gradient(135deg,#168be1,#075ea8);color:#fff}.chat-login-overlay{position:fixed;inset:0;z-index:500;display:flex;align-items:center;justify-content:center;padding:20px;background:rgba(10,20,35,.55);backdrop-filter:blur(8px)}.chat-login-overlay.hidden{display:none}.chat-login-card{width:min(340px,100%);background:#fff;border-radius:24px;padding:30px 24px;text-align:center}.chat-login-icon{width:60px;height:60px;margin:0 auto 14px;border-radius:50%;background:linear-gradient(135deg,#eaf5ff,#d9eafa);display:flex;align-items:center;justify-content:center;font-size:27px}.chat-login-card h3{margin:0 0 8px;font-size:16.5px;font-weight:900}.chat-login-card p{margin:0 0 18px;font-size:12.5px;color:var(--muted);line-height:1.9}.chat-login-card .btn{width:100%;min-height:46px;border-radius:13px;background:linear-gradient(135deg,#168be1,#075ea8);color:#fff;font-size:13.5px;font-weight:900}.chat-room{position:fixed;inset:0;z-index:200;display:flex;flex-direction:column;background:var(--bg);transform:translateX(100%);transition:transform .28s cubic-bezier(.2,.8,.2,1)}.chat-room.open{transform:translateX(0)}.chat-room-header{flex:0 0 auto;height:60px;display:flex;align-items:center;gap:10px;padding:0 12px;background:linear-gradient(135deg,#064f8f,#0869b7 60%,#168be1);color:#fff;box-shadow:0 8px 22px rgba(5,65,120,.16)}.chat-room-back{width:36px;height:36px;border-radius:11px;display:flex;align-items:center;justify-content:center;background:rgba(255,255,255,.14);flex:0 0 36px}.chat-room-title{flex:1;min-width:0}.chat-room-name{font-size:14.5px;font-weight:900;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.chat-room-ad{font-size:10.5px;color:rgba(255,255,255,.78);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.chat-room-menu-btn{width:36px;height:36px;border-radius:11px;display:flex;align-items:center;justify-content:center;background:rgba(255,255,255,.14);color:#fff;flex:0 0 36px}.chat-room-body{flex:1;overflow-y:auto;padding:16px 12px;display:flex;flex-direction:column;gap:9px}.chat-blocked-banner{text-align:center;font-size:11.5px;color:var(--danger);background:#fdecea;border-radius:12px;padding:10px;margin-bottom:6px}.msg-bubble{max-width:78%;padding:10px 13px;border-radius:16px;font-size:13px;line-height:1.85;word-break:break-word;position:relative}.msg-bubble.other{align-self:flex-start;background:#fff;color:var(--text);border-bottom-left-radius:5px;box-shadow:0 3px 10px rgba(16,52,89,.05)}.msg-bubble.mine{align-self:flex-end;background:linear-gradient(135deg,#168be1,#075ea8);color:#fff;border-bottom-right-radius:5px}.msg-time{display:block;margin-top:4px;font-size:9.5px;opacity:.75;text-align:left}.chat-room-inputbar{flex:0 0 auto;display:flex;align-items:center;gap:8px;padding:10px 12px calc(10px + var(--safe-bottom));background:#fff;border-top:1px solid var(--line)}.chat-room-input{flex:1;min-height:44px;max-height:110px;border:1px solid var(--line);background:#f7f9fb;border-radius:16px;padding:11px 15px;font-size:13px;color:var(--text);resize:none}.chat-room-input:focus{outline:0;border-color:var(--accent);background:#fff}.chat-room-mic,.chat-room-send{flex:0 0 44px;width:44px;height:44px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:#fff}.chat-room-mic{background:linear-gradient(135deg,#147ed1,#0a5ea7)}.chat-room-mic.listening{background:linear-gradient(135deg,#ff5a6e,#dc2f45);animation:1.2s ease-in-out infinite micPulse}@keyframes micPulse{0%,100%{box-shadow:0 0 0 0 rgba(220,47,69,.35)}50%{box-shadow:0 0 0 8px rgba(220,47,69,0)}}.chat-room-send{background:linear-gradient(135deg,#22cf79,#0e9e56)}.chat-room-mic svg,.chat-room-send svg{width:19px;height:19px}.room-menu-overlay{position:fixed;inset:0;z-index:250;background:0 0}.room-menu-overlay.hidden{display:none}.room-menu{position:fixed;top:64px;left:12px;z-index:260;width:210px;background:#fff;border-radius:16px;box-shadow:0 20px 45px rgba(16,27,45,.2);padding:6px;display:flex;flex-direction:column;gap:2px}.room-menu-item{display:flex;align-items:center;gap:10px;padding:11px 12px;border-radius:11px;font-size:12.5px;font-weight:700;color:var(--text)}.room-menu-item:active{background:#f5f8fb}.room-menu-item.danger{color:var(--danger)}::-webkit-scrollbar{width:5px;height:5px}::-webkit-scrollbar-thumb{background:#cfd8e3;border-radius:5px}@media(min-width:640px){.chat-room{max-width:520px;left:50%;transform:translate(-50%,20px);top:0;bottom:0;right:auto;opacity:0;transition:opacity .25s,transform .25s}.chat-room.open{opacity:1;transform:translate(-50%,0)}}.chat-room-avatar{flex:0 0 40px;width:40px;height:40px;border-radius:50%;overflow:hidden;display:flex;align-items:center;justify-content:center;background:rgba(255,255,255,.18);color:#fff;font-size:17px;cursor:pointer;border:2px solid rgba(255,255,255,.4)}.chat-room-avatar img{width:100%;height:100%;object-fit:cover}.avatar-viewer-overlay{position:fixed;inset:0;z-index:9999;display:flex;align-items:center;justify-content:center;background:rgba(0,0,0,.86);backdrop-filter:blur(6px)}.avatar-viewer-overlay.hidden{display:none}.avatar-viewer-circle{width:min(78vw,320px);height:min(78vw,320px);border-radius:50%;overflow:hidden;border:3px solid rgba(255,255,255,.35);box-shadow:0 25px 70px rgba(0,0,0,.5);animation:.22s avatarViewerPop}@keyframes avatarViewerPop{from{transform:scale(.85);opacity:0}to{transform:scale(1);opacity:1}}.avatar-viewer-circle img{width:100%;height:100%;object-fit:cover}.chat-banned-overlay{position:fixed;inset:0;z-index:9998;display:flex;align-items:center;justify-content:center;padding:24px;background:var(--bg)}.chat-banned-overlay.hidden{display:none}.chat-banned-card{width:min(360px,100%);text-align:center;background:#fff;border-radius:24px;padding:34px 24px;box-shadow:0 20px 55px rgba(16,27,45,.15)}.chat-banned-icon{width:70px;height:70px;margin:0 auto 16px;border-radius:50%;background:#fdecea;color:var(--danger);display:flex;align-items:center;justify-content:center;font-size:32px}.chat-banned-card h3{margin:0 0 10px;font-size:16.5px;font-weight:900;color:var(--text)}.chat-banned-card p{margin:0 0 22px;font-size:12.5px;color:var(--muted);line-height:2}.chat-banned-card .btn{width:100%;min-height:46px;border-radius:13px;background:linear-gradient(135deg,#168be1,#075ea8);color:#fff;font-size:13.5px;font-weight:900}.chat-list-wrap{padding-bottom:calc(96px + var(--safe-bottom))!important;transition:none!important}.avatar-viewer-overlay,.chat-login-overlay,.chat-settings-overlay,.confirm-overlay{-webkit-backdrop-filter:none!important;backdrop-filter:none!important}.chat-card,a,body,button,html{touch-action:manipulation}@font-face{font-family:BamalFantasy;src:url("assets/fonts/bamal-fantasy.woff2") format("woff2");font-display:swap}.pc-card{position:relative;display:flex;align-items:center;gap:12px;padding:13px 14px;background:linear-gradient(135deg,#eef6ff,#f6f0ff 60%,#fff4f8);border-bottom:1px solid var(--line);cursor:pointer;user-select:none;-webkit-user-select:none}.pc-card:active{filter:brightness(.97)}.pc-card.has-alert{background:linear-gradient(135deg,#fff8dc,#fff1c2)}.pc-avatar,.pc-room-avatar{flex:0 0 48px;width:48px;height:48px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,#168be1,#7b3fe4 60%,#e0488a);color:#fff;font-family:BamalFantasy,Lalezar,Vazirmatn,sans-serif;font-size:24px;font-weight:900;box-shadow:0 6px 16px rgba(123,63,228,.3)}.pc-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:4px}.pc-top{display:flex;align-items:center;justify-content:space-between;gap:8px}.pc-name{font-family:BamalFantasy,Lalezar,Vazirmatn,sans-serif;font-weight:900;font-size:17px;letter-spacing:.3px;background:linear-gradient(90deg,#0b5fa5,#7b3fe4,#e0488a);-webkit-background-clip:text;background-clip:text;color:transparent;-webkit-text-fill-color:transparent}.pc-pin{flex:0 0 auto;font-size:10px;font-weight:800;color:#7b3fe4;background:rgba(123,63,228,.1);padding:2px 8px;border-radius:999px}.pc-last{font-size:12px;color:var(--text-2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.pc-dot{flex:0 0 auto;width:12px;height:12px;border-radius:50%;background:#ef4136;border:2px solid #fff;animation:1.6s ease-in-out infinite pcPulse}@keyframes pcPulse{0%,100%{box-shadow:0 0 0 0 rgba(239,65,54,.55)}50%{box-shadow:0 0 0 7px rgba(239,65,54,0)}}.pc-room{position:fixed;inset:0;z-index:260;display:flex;flex-direction:column;background:var(--bg);transform:translateX(100%);transition:transform .28s cubic-bezier(.2,.8,.2,1)}.pc-room.open{transform:translateX(0)}.pc-room-head{flex:0 0 auto;height:60px;display:flex;align-items:center;gap:10px;padding:0 12px;background:linear-gradient(135deg,#064f8f,#0869b7 60%,#168be1);color:#fff;box-shadow:0 8px 22px rgba(5,65,120,.16)}.pc-room-back{flex:0 0 36px;width:36px;height:36px;border-radius:11px;display:flex;align-items:center;justify-content:center;background:rgba(255,255,255,.14);color:#fff}.pc-room-avatar{flex:0 0 40px;width:40px;height:40px;font-size:20px;border:2px solid rgba(255,255,255,.4)}.pc-room-title{flex:1;min-width:0}.pc-name-light{background:0 0;-webkit-text-fill-color:#fff;color:#fff;font-size:17px}.pc-room-sub{font-size:10.5px;color:rgba(255,255,255,.8)}.pc-room-body{flex:1;overflow-y:auto;padding:16px 12px calc(20px + var(--safe-bottom));display:flex;flex-direction:column;gap:12px}.pc-msg{border-radius:18px;padding:14px 15px;box-shadow:0 4px 14px rgba(16,52,89,.07)}.pc-msg.welcome{background:#fff;border:1px solid #d7e9fb}.pc-msg.alert{background:#fff8dc;border:1.5px solid #f0c040}.pc-msg-title{font-size:13.5px;font-weight:900;margin-bottom:8px;color:var(--text)}.pc-msg.alert .pc-msg-title{color:#8a5a00}.pc-msg-text{font-size:12.5px;line-height:2.05;color:var(--text-2);white-space:pre-line}.pc-msg.alert .pc-msg-text{color:#6b4a00}.pc-rows{margin-top:10px;border-radius:12px;background:rgba(240,192,64,.18);padding:4px 12px}.pc-row{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 0;border-bottom:1px dashed rgba(138,90,0,.25);font-size:12px;color:#6b4a00}.pc-row:last-child{border-bottom:0}.pc-row b{font-weight:800;text-align:left}.pc-msg-time{margin-top:10px;font-size:10px;color:var(--muted);text-align:left}.pc-msg.bc{background:#fff;border:1px solid #e3e7ec;border-radius:16px;padding:13px;max-width:100%;align-self:stretch}.pc-bc-title{font-size:16px;font-weight:900;color:#172033;line-height:1.7;margin-bottom:6px;word-break:break-word}.pc-bc-text{font-size:13px;line-height:2;color:#344054;white-space:pre-wrap;word-break:break-word}.pc-media{margin-top:10px;border-radius:12px;overflow:hidden;background:#000}.pc-media-img,.pc-media-vid{display:block;width:100%;max-height:60vh;object-fit:contain;background:#000}.pc-media-img{cursor:zoom-in}.pc-bc-actions{margin-top:10px}.pc-save{display:inline-flex;align-items:center;gap:7px;padding:9px 14px;border-radius:11px;background:#eaf4ff;color:#075ea8;font-size:12.5px;font-weight:800;text-decoration:none}.pc-viewer{position:fixed;inset:0;z-index:99999;background:#000;display:flex;align-items:center;justify-content:center}.pc-viewer img{max-width:100%;max-height:100%;object-fit:contain}.pc-viewer-x{position:absolute;top:calc(12px + env(safe-area-inset-top,0px));left:14px;width:40px;height:40px;border:0;border-radius:50%;background:rgba(255,255,255,.2);color:#fff;font-size:24px}.pc-viewer-save{position:absolute;bottom:calc(20px + env(safe-area-inset-bottom,0px));left:50%;transform:translateX(-50%)}