*{box-sizing:border-box}
html,body{width:100%;height:100%;margin:0;overflow:hidden;font-family:Inter,Segoe UI,Arial,sans-serif;background:#eef1f5;color:#eef3fb}
button,input,textarea{font:inherit}
button{cursor:pointer}
.wrap{width:100vw;height:100vh;display:flex;justify-content:center;align-items:center}
.phone{width:min(430px,100vw);height:min(900px,100vh);background:#0d1422;overflow:hidden;position:relative;border-radius:28px;box-shadow:0 24px 70px rgba(0,0,0,.22)}
@media(max-width:700px){.wrap{display:block}.phone{width:100vw;height:100vh;border-radius:0;box-shadow:none}}
.login{height:100%;display:grid;place-items:center;padding:28px;background:radial-gradient(circle at 20% 0,#28478b 0,#111827 35%,#0b1020 70%)}
.card{width:100%;background:#101827ee;border:1px solid #2b3850;border-radius:24px;padding:26px;backdrop-filter:blur(12px)}
.logo{font-size:44px}.card h1{margin:8px 0 5px}.muted{color:#9aa8bd;font-size:13px}
.field{width:100%;margin-top:12px;background:#0a1120;border:1px solid #29364e;color:#fff;border-radius:12px;padding:13px;outline:0}
textarea.field{resize:none}
.primary,.add{width:100%;margin-top:15px;border:0;border-radius:12px;padding:13px;background:#5b8cff;color:white;font-weight:800}
.switch,.close{width:100%;margin-top:10px;border:1px solid #2b3a54;border-radius:12px;padding:12px;background:transparent;color:#9ab8ff;font-weight:700}
.close{background:#182235;color:#bdc8d9}
.hint{margin-top:14px;color:#8090aa;font-size:11px;text-align:center}
.app{height:100%;display:flex;flex-direction:column}.top{height:65px;background:#101827;border-bottom:1px solid #263249;display:flex;align-items:center;padding:10px 14px;gap:10px}
.av{width:39px;height:39px;border-radius:50%;display:grid;place-items:center;background:linear-gradient(135deg,#315fce,#8a5cff);font-weight:800;overflow:hidden;flex:0 0 auto}
.av img{width:100%;height:100%;object-fit:cover}.profileBtn{border:0;background:transparent;padding:0;border-radius:50%}.profileArea{cursor:pointer;min-width:0;flex:1}.profileArea strong{display:block;font-size:14px}.profileArea small{display:block;color:#8f9db2;font-size:11px;margin-top:2px}
.iconBtn{background:#182235;border:1px solid #2b3850;color:#e7eefb;font-size:15px;padding:7px 9px;border-radius:9px}
.body{flex:1;display:flex;min-height:0}.side{width:108px;border-right:1px solid #263249;background:#0b1220;padding:8px;overflow:auto}
.side h4{font-size:9px;color:#7f8da4;letter-spacing:1px;margin:9px 7px}.person{padding:10px 5px;border-radius:12px;background:#182235;cursor:pointer;margin-bottom:7px}
.person .av{width:31px;height:31px;font-size:12px;margin-bottom:6px}.person b{font-size:11px;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.person span{font-size:9px;color:#8593a8}
.chat{flex:1;display:flex;flex-direction:column;min-width:0}.chathead{height:57px;display:flex;align-items:center;gap:9px;padding:9px 12px;border-bottom:1px solid #263249}
.chathead .av{width:32px;height:32px;font-size:12px}.chathead b{font-size:12px}.chathead small{display:block;color:#54d58a;font-size:9px}
.msgs{flex:1;overflow:auto;padding:12px;display:flex;flex-direction:column;gap:8px}.bubble{max-width:84%;padding:8px 10px;border-radius:13px;background:#192337;border:1px solid #29364e;font-size:11px;line-height:1.4;word-break:break-word}.mine{align-self:flex-end;background:#315fce;border-color:#4774d8}.time{font-size:8px;color:#b8c4d7;text-align:right;margin-top:3px}
.composer{display:flex;gap:5px;padding:9px;border-top:1px solid #263249;background:#101827}.composer input{min-width:0;flex:1;background:#0a1120;border:1px solid #29364e;color:#fff;border-radius:11px;padding:9px;font-size:11px}.composer button{border:0;border-radius:10px;background:#5b8cff;color:#fff;padding:0 11px;font-weight:800}.composer .attachBtn{background:#182235;border:1px solid #2b3850;padding:0 10px;font-size:16px}.composer .attachBtn:disabled{opacity:.6}.chatMedia{display:block;max-width:240px;max-height:260px;width:auto;height:auto;border-radius:10px;object-fit:cover}.mediaLink{display:block}.imageOpenButton{border:0;background:transparent;padding:0;cursor:zoom-in;max-width:100%;line-height:0}.bubble:has(.chatMedia){padding:5px;overflow:hidden}
#modal{position:absolute;inset:0;background:rgba(2,5,11,.97);z-index:20;display:none;align-items:flex-end}.sheet{width:100%;max-height:92%;overflow:auto;background:#111827;border-top:1px solid #34415a;border-radius:24px 24px 0 0;padding:18px}
.acct{display:flex;align-items:center;gap:10px;padding:11px;border:1px solid #2b3850;border-radius:13px;background:#0c1422;margin:8px 0;cursor:pointer}.ainfo{flex:1}.ainfo b{display:block;font-size:12px}.ainfo span{font-size:10px;color:#8795aa}
.error{color:#ff9aa4;font-size:12px;margin-top:10px}.success{color:#68e39a;font-size:12px;margin-top:10px}
@media(max-width:430px){.side{width:96px}}

/* Phase 2: voice/video call UI */
.chatheadTitle{min-width:0;flex:1}.callActions{display:flex;gap:6px;margin-left:auto}.callBtn{width:32px;height:32px;border-radius:10px;border:1px solid #2b3850;background:#182235;color:#eaf0ff;font-size:17px;font-weight:700}.callBtn:hover,.callToggle:hover{background:#263752}.callShade{position:absolute;inset:0;z-index:50;background:#030712d9;display:grid;place-items:center;padding:16px}.callPanel{width:min(100%,360px);border:1px solid #34415a;border-radius:22px;background:#101827;padding:24px;text-align:center;box-shadow:0 24px 80px #0009}.callPanel h3{margin:12px 0 5px}.callPanel p{color:#9aa8bd;font-size:13px}.callAvatar{width:72px;height:72px;margin:0 auto;border-radius:50%;display:grid;place-items:center;background:linear-gradient(135deg,#315fce,#8a5cff);font-size:28px;font-weight:800}.callControls{display:flex;justify-content:center;gap:8px;flex-wrap:wrap;margin-top:20px}.callControls button{border:0;border-radius:12px;padding:11px 14px;color:#fff;font-weight:700}.acceptCall{background:#168b57}.endCall{background:#dc3545}.callToggle{background:#263752}.videoStage{position:relative;height:220px;border-radius:15px;background:#050914;overflow:hidden;display:grid;place-items:center}.videoStage #remoteVideo{width:100%;height:100%;object-fit:contain}.videoStage #localVideo{position:absolute;right:8px;bottom:8px;width:90px;height:120px;object-fit:cover;border:1px solid #73809a;border-radius:10px;background:#111827}.voicePulse{width:86px;height:86px;border-radius:50%;display:grid;place-items:center;background:#243b68;font-size:32px}


/* Phase 2.1: responsive full-screen calling */
#callLayer{position:absolute;inset:0;z-index:50;pointer-events:none}
#callLayer:empty{display:none}
.callShade{position:fixed;inset:0;z-index:1000;background:rgba(2,6,18,.94);display:flex;align-items:center;justify-content:center;padding:0;pointer-events:auto;backdrop-filter:blur(10px)}
.callPanel{width:100%;height:100%;max-width:none;max-height:none;border:0;border-radius:0;padding:clamp(14px,2.5vw,32px);display:flex;flex-direction:column;align-items:center;justify-content:center;overflow:hidden;box-shadow:none;background:#080d18}
.callPanel.activeCallPanel{gap:clamp(8px,1.5vh,18px)}
.callPanel.activeCallPanel h3{margin:0;font-size:clamp(18px,2.2vw,28px)}
.callPanel.activeCallPanel p{margin:0 0 4px;font-size:clamp(12px,1.2vw,15px)}
.videoStage{position:relative;width:100%;height:auto;flex:1;min-height:0;max-height:calc(100dvh - 150px);aspect-ratio:16/9;border-radius:16px;background:#02050b;overflow:hidden;display:block}
.videoStage #remoteVideo{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;background:#02050b}
.videoStage #localVideo{position:absolute;right:clamp(10px,2vw,24px);bottom:clamp(10px,2vw,24px);width:clamp(88px,18vw,220px);height:auto;aspect-ratio:9/16;max-height:36%;object-fit:cover;border:2px solid #dce6ff;border-radius:12px;background:#111827;z-index:2}
.callControls{margin-top:8px;gap:10px}
.callControls button{min-height:44px;padding:12px 18px}
.callAvatar{flex:0 0 auto}
@media (max-width:700px) and (orientation:portrait){
  .callPanel.activeCallPanel{padding:12px;gap:10px}
  .videoStage{aspect-ratio:9/16;flex:1;width:100%;height:auto;max-height:calc(100dvh - 190px);min-height:0;border-radius:14px}
  .videoStage #remoteVideo{object-fit:cover}
  .videoStage #localVideo{width:27%;max-width:145px;max-height:28%;right:10px;bottom:10px;border-radius:10px}
  .callControls{width:100%;gap:8px;flex-wrap:wrap;margin-top:4px}
  .callControls button{flex:1 1 auto;min-width:88px;padding:11px 12px;font-size:14px}
  .callPanel.activeCallPanel h3{font-size:20px}
}
@media (min-width:701px), (orientation:landscape){
  .callPanel.activeCallPanel{width:100%;height:100%;padding:clamp(16px,3vh,36px)}
  .videoStage{width:100%;height:auto;flex:1;aspect-ratio:16/9;max-height:calc(100dvh - 155px)}
}

/* Connect With 143 contact and verification additions */
.success{color:#57d99b}.clickableProfile{cursor:pointer}.profileBtn{cursor:pointer}

/* In-app full-screen photo viewer */
.imageOpenBtn{display:block;border:0;padding:0;background:transparent;cursor:zoom-in;text-align:left;max-width:100%}.imageViewer{position:fixed;inset:0;z-index:1000;background:rgba(0,0,0,.96);display:none;align-items:center;justify-content:center;padding:60px 16px 24px}.imageViewer img{max-width:100%;max-height:100%;object-fit:contain}.imageViewerClose,.imageViewerDownload{position:absolute;top:14px;border:1px solid #ffffff44;background:#182235;color:#fff;border-radius:12px;padding:10px 14px;text-decoration:none;font-size:16px}.imageViewerClose{right:14px;font-size:28px;line-height:24px}.imageViewerDownload{left:14px}.imageViewer[style*="display: flex"]{display:flex!important}
#cropControls{border:1px solid #34415a;border-radius:14px;padding:12px;margin:10px 0}#cropControls[hidden]{display:none!important}#cropControls input[type=range]{padding:0;accent-color:#7196ff}.mediaLink{cursor:pointer}

/* Interaction reliability: keep photo and message controls above media. */
.imageOpenBtn{position:relative;z-index:2;pointer-events:auto;touch-action:manipulation;cursor:zoom-in}
.messageMenuTrigger{z-index:1600!important;pointer-events:auto!important;touch-action:manipulation}
.messageMenu{z-index:1601!important}
.imageViewer{z-index:99999!important}


/* Mobile chat: keep touch scrolling, hide only the visual scrollbars. */
@media (max-width: 700px), (pointer: coarse) {
  .msgs, .side {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
  .msgs::-webkit-scrollbar, .side::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
  }
}


/* Latest UI polish: profile sheet must cover message controls behind it. */
#modal{z-index:5000!important;}
.messageMenu{width:240px!important;max-width:calc(100vw - 24px)!important;}
.profilePhotoZoomable{cursor:zoom-in;}
.profilePhotoViewer{position:fixed;inset:0;z-index:1000000;display:none;align-items:center;justify-content:center;padding:24px;background:rgba(0,0,0,.94);backdrop-filter:blur(5px);}
.profilePhotoViewer img{display:block;width:min(76vw,420px);height:min(76vw,420px);max-width:84vh;max-height:84vh;aspect-ratio:1/1;object-fit:cover;border-radius:50%;box-shadow:0 18px 70px rgba(0,0,0,.55);border:2px solid rgba(255,255,255,.22);}
.profilePhotoViewerClose{position:absolute;top:max(14px,env(safe-area-inset-top));right:max(14px,env(safe-area-inset-right));width:44px;height:44px;border:1px solid #ffffff44;border-radius:50%;background:#182235;color:#fff;font-size:30px;line-height:1;cursor:pointer;}
@media(max-width:700px){.messageMenu{width:min(230px,calc(100vw - 24px))!important}.profilePhotoViewer img{width:min(78vw,360px);height:min(78vw,360px);}}


/* Responsive viewport sizing: fill the browser's visible area on phones without hiding browser chrome. */
html,body{min-height:100%;height:100%;}
.wrap{height:100vh;height:100dvh;min-height:0;}
.phone{height:min(900px,100dvh);}
@media (max-width:900px), (pointer:coarse) and (orientation:portrait){
  html,body,#app,.wrap{width:100%;height:100%;min-height:0;}
  .wrap{display:block;height:100vh;height:100dvh;}
  .phone{width:100%;max-width:none;height:100vh;height:100dvh;min-height:0;border-radius:0;box-shadow:none;}
  .app{height:100%;min-height:0;}
  .top{flex:0 0 58px;min-height:58px;padding:8px 10px;gap:7px;}
  .body{flex:1;min-height:0;}
  .chat{min-height:0;}
  .msgs{min-height:0;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;}
  .composer{flex:0 0 auto;padding-bottom:max(8px,env(safe-area-inset-bottom));}
  #modal{position:fixed;inset:0;align-items:center;justify-content:center;padding:12px;overflow:auto;}
  #modal .sheet{width:100%;max-width:520px;max-height:calc(100dvh - 24px);border-radius:18px;padding:14px;}
  #modal .contactInfoSheet,#modal .galleryInfoSheet{width:100%;max-width:520px;max-height:calc(100dvh - 24px);}
}
@media (max-width:430px){
 .side{width:min(104px,29vw);}
 .bubble{font-size:13px;}
 .messageMenu{width:min(218px,calc(100vw - 20px))!important;max-width:calc(100vw - 20px)!important;max-height:55dvh!important;border-radius:12px;padding:4px;}
 .messageMenu button,.messageMenu a{padding:8px 10px!important;font-size:13px!important;}
 .messageMenuTrigger{width:27px;height:27px;}
 .editMessageSheet{width:100%!important;max-width:420px!important;}
}
.editMessageSheet{align-self:center;margin:auto;width:min(92vw,420px)!important;max-height:min(70dvh,440px)!important;border:1px solid #2b3850;border-radius:18px!important;padding:16px!important;}
.editMessageHeader{display:flex;align-items:center;justify-content:space-between;gap:10px}.editMessageHeader h3{margin:0;font-size:17px}.editClose{border:0;background:transparent;color:#eaf0ff;font-size:26px;line-height:1}.editMessageInput{display:block;width:100%;min-height:105px;resize:vertical;font-size:16px;line-height:1.45}.editMessageActions{display:flex;gap:8px;justify-content:flex-end;margin-top:10px}.editMessageActions button{width:auto;min-width:90px;margin-top:0}.editMessageHint{margin-top:10px;font-size:11px;line-height:1.4}.clearChatAction{display:block;width:100%;margin:10px 0;border:1px solid #7f343d;background:#29171f;color:#ffb8bf;padding:12px;border-radius:10px;text-align:left}.selectionActionBar{display:flex;align-items:center;gap:8px;padding:8px 10px;background:#16243a;border-bottom:1px solid #33435d;flex:0 0 auto}.selectionActionBar span{flex:1;font-size:12px}.selectionActionBar button{border:1px solid #34435e;background:#243550;color:#f2f5ff;padding:7px 10px;border-radius:8px;font-size:12px}

/* October responsive and selection update: full browser workspace, readable typography. */
html,body{width:100%;height:100%;margin:0;overflow:hidden;font-family:Inter,"Segoe UI",Arial,sans-serif;-webkit-text-size-adjust:100%;text-size-adjust:100%}
.wrap{width:100%;height:100vh;height:100dvh;min-height:0;display:block;overflow:hidden}
.phone{width:100%;max-width:none;height:100vh;height:100dvh;min-height:0;border-radius:0;box-shadow:none;overflow:hidden}
#app,.app{width:100%;height:100%;min-width:0;min-height:0}
.login{min-height:0;padding:clamp(16px,4vw,40px)}
.card{width:min(520px,100%);padding:clamp(20px,3vw,32px);border-radius:22px}
.card h1{font-size:clamp(22px,2.5vw,30px);line-height:1.2}
.logo{font-size:clamp(36px,5vw,48px)}
.top{flex:0 0 68px;min-height:68px;padding:10px clamp(12px,2vw,24px);gap:12px}
.top .profileArea strong{font-size:clamp(14px,1.2vw,17px)}
.top .iconBtn{min-width:40px;min-height:40px;font-size:16px}
.body{min-height:0;width:100%;flex:1}
.chat{min-width:0;min-height:0;flex:1 1 auto;width:100%}
.chathead{flex:0 0 64px;height:64px;min-height:64px;padding:10px clamp(12px,2vw,24px);gap:12px}
.chathead b{font-size:clamp(14px,1.15vw,17px)}
.chathead small{font-size:12px}
.chathead .av{width:40px;height:40px;font-size:14px}
.msgs{padding:clamp(10px,1.8vw,22px);gap:10px;min-height:0;font-size:15px;line-height:1.5;background-color:#0d1422;background-repeat:no-repeat;background-attachment:local}
.bubble{max-width:min(86%,720px);padding:11px 14px;border-radius:16px;font-size:15px;line-height:1.5;overflow-wrap:anywhere}
.bubble .messageText{font-size:15px;line-height:1.5}
.bubble:has(.chatMedia),.bubble:has(video.chatMedia){max-width:min(78%,560px)!important}
.bubble .chatMedia,.bubble video.chatMedia{max-width:min(100%,520px)!important;max-height:62dvh!important;border-radius:10px}
.messageMenuTrigger{width:30px;height:30px;font-size:20px}
.messageFooter{font-size:11px!important;gap:6px}
.time{font-size:10px}
.composer{flex:0 0 auto;min-height:64px;padding:10px clamp(10px,1.8vw,22px);gap:8px;padding-bottom:max(10px,env(safe-area-inset-bottom))}
.composer input{font-size:16px;padding:12px 14px;min-height:44px;border-radius:13px}
.composer button{min-width:44px;min-height:44px;font-size:18px}
.composer .attachBtn{min-width:44px}
.person b,.contactNames b{font-size:14px}
.person span,.contactNames span{font-size:12px}
.field{font-size:16px}
.selectionActionBar{order:3;display:flex;align-items:center;gap:clamp(5px,1vw,12px);flex:0 0 auto;min-height:62px;padding:9px clamp(10px,2vw,22px);background:#f8f9fc;color:#1f2937;border-top:1px solid #d9dee8;border-bottom:0;box-shadow:0 -8px 24px #0002;padding-bottom:max(9px,env(safe-area-inset-bottom));z-index:20}
.selectionActionBar span{flex:1;min-width:54px;font-size:14px;font-weight:650;white-space:nowrap}
.selectionActionBar button{width:auto;min-width:42px;min-height:42px;padding:8px 12px;border:0;border-radius:10px;background:transparent;color:#263244;font-size:20px;display:flex;align-items:center;justify-content:center}
.selectionActionBar button.selectionDelete{background:#e33445;color:white}
.selectionActionBar button.selectionCancel{font-size:26px;font-weight:300}
.bubble.messageSelected{outline:3px solid #57b9ff!important;outline-offset:1px;filter:brightness(1.12)}
.bubble.messageSelected:before{content:"✓";position:absolute;left:-9px;top:50%;transform:translate(-50%,-50%);width:24px;height:24px;border-radius:50%;display:grid;place-items:center;background:#1689e8;color:#fff;border:2px solid #fff;font-size:14px;font-weight:800;z-index:3}
.wallpaperSheet{width:min(94vw,520px)!important;max-height:calc(100dvh - 24px)!important;overflow:auto}
.wallpaperChoices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:16px 0}
.wallpaperChoice{display:flex;align-items:center;gap:9px;min-width:0;padding:8px;border:1px solid #34415a;border-radius:12px;background:#0d1422;color:#eef3fb;text-align:left;font-size:13px}
.wallpaperChoice span{display:block;flex:0 0 48px;width:48px;height:42px;border-radius:8px;border:1px solid #ffffff25}
.wallpaperChoice b{flex:1;font-size:13px;font-weight:600}
.wallpaperChoice.active{border-color:#6592ff;box-shadow:0 0 0 1px #6592ff55}
@media(max-width:700px){
  .top{flex-basis:58px;min-height:58px;height:58px;padding:7px 9px;gap:7px}
  .top .iconBtn{min-width:35px;min-height:35px;padding:6px;font-size:14px}
  .top .av{width:34px;height:34px}
  .chathead{flex-basis:60px;height:60px;min-height:60px;padding:8px 10px;gap:8px}
  .chathead .av{width:35px;height:35px}
  .chathead b{font-size:15px}
  .chathead small{font-size:11px}
  .msgs{padding:10px;gap:8px}
  .bubble{max-width:90%;font-size:15px;padding:10px 12px}
  .bubble .messageText{font-size:15px}
  .bubble:has(.chatMedia),.bubble:has(video.chatMedia){max-width:86%!important}
  .bubble .chatMedia,.bubble video.chatMedia{max-width:min(100%,calc(100vw - 76px))!important;max-height:58dvh!important}
  .composer{min-height:58px;padding:7px 8px;padding-bottom:max(7px,env(safe-area-inset-bottom));gap:6px}
  .composer input{font-size:16px;padding:10px 12px;min-height:42px}
  .composer button{min-width:42px;min-height:42px}
  .selectionActionBar{gap:3px;padding:7px 6px;padding-bottom:max(7px,env(safe-area-inset-bottom));min-height:58px}
  .selectionActionBar span{font-size:12px;min-width:48px}
  .selectionActionBar button{min-width:35px;min-height:40px;padding:6px;font-size:18px}
  .selectionActionBar button:last-child{font-size:12px;padding:6px 8px}
  .wallpaperChoices{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .wallpaperChoice{font-size:12px;padding:7px;gap:6px}
  .wallpaperChoice span{flex-basis:38px;width:38px;height:38px}
}
@media(min-width:701px){
  .side{width:250px;flex-basis:250px;min-width:250px;max-width:250px}
  .side.sidebar-visible{width:250px!important;flex-basis:250px!important;min-width:250px!important;max-width:250px!important}
  .person{padding:10px;display:flex;align-items:center;gap:10px}
  .person .av{margin:0;width:40px;height:40px}
  .bubble{max-width:min(76%,780px)}
}
@media(max-width:700px){
  .profileQuickActions{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px!important}
  .profileQuickActions button{width:auto!important;min-width:0;height:58px!important;font-size:18px!important}
  .profileQuickActions span{font-size:10px!important}
}

/* Compact wallpaper picker and actions */
.wallpaperSheet{width:min(92vw,420px)!important;padding:16px!important;gap:10px!important}
.wallpaperSheet .muted{display:none}
.wallpaperChoices{gap:8px!important;margin:8px 0 4px!important}
.wallpaperChoice{position:relative;min-height:54px;padding:7px!important;border-radius:10px!important}
.wallpaperChoice span:first-child{flex:0 0 44px!important;width:44px!important;height:38px!important}
.wallpaperChoice b{font-size:13px!important}
.wallpaperChoice .wallpaperCheck{flex:0 0 auto!important;width:auto!important;height:auto!important;border:0!important;background:transparent!important;color:#8eb0ff;font-weight:800}
.wallpaperApplyActions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:8px}
.wallpaperApplyActions button,.wallpaperReset{min-height:42px;border:1px solid #34415a;border-radius:10px;background:#172238;color:#eef3fb;font-size:13px;font-weight:600;padding:9px 12px}
.wallpaperApplyActions .wallpaperApplyPrimary{background:#5a88ff;border-color:#5a88ff;color:#fff}
.wallpaperReset{width:100%;min-height:36px;background:transparent;border-color:transparent;color:#aebbd1;font-weight:500}
@media(max-width:700px){.wallpaperSheet{width:min(92vw,380px)!important;padding:13px!important}.wallpaperChoice{min-height:48px}.wallpaperChoice span:first-child{flex-basis:36px!important;width:36px!important;height:34px!important}}

/* Final mobile-first readability and WhatsApp-like chat polish. */
html,body,.wrap,.phone,#app,.app,.body,.chat{box-sizing:border-box;min-width:0;max-width:100%;}
body{font-family:Inter,"Segoe UI",Roboto,Arial,sans-serif!important;}
.chathead{gap:12px!important;padding:10px 14px!important;min-height:68px!important;height:68px!important;flex:0 0 68px!important;}
.chathead .av,.chathead .profileBtn .av{width:44px!important;height:44px!important;min-width:44px!important;font-size:17px!important;}
.chatheadTitle{min-width:0!important;flex:1 1 auto!important;}
.chatheadTitle b,.chathead b{font-size:17px!important;line-height:1.25!important;font-weight:650!important;letter-spacing:0!important;}
.chatheadTitle small,.chathead small{font-size:12px!important;line-height:1.35!important;display:block!important;margin-top:3px!important;}
.top .av{width:42px!important;height:42px!important;min-width:42px!important;}
.top .profileArea strong{font-size:16px!important;line-height:1.25!important;}
.person .av{width:44px!important;height:44px!important;min-width:44px!important;margin:0!important;}
.person,.contactNames{min-width:0!important;}
.contactNames b,.person b{font-size:14px!important;line-height:1.3!important;}
.contactNames span,.person span,.presenceLabel{font-size:12px!important;line-height:1.3!important;}
.contactNames small{font-size:11px!important;line-height:1.3!important;}
.msgs{font-size:16px!important;line-height:1.5!important;padding:12px clamp(10px,2vw,24px)!important;gap:9px!important;}
.bubble{font-size:16px!important;line-height:1.5!important;padding:10px 14px!important;max-width:min(88%,760px)!important;border-radius:16px!important;}
.bubble .messageText,.bubble .documentLink,.bubble a.linkPreview{font-size:16px!important;line-height:1.5!important;}
.bubble .messageFooter{font-size:11px!important;line-height:1.2!important;}
.bubble .time{font-size:11px!important;}
.bubble .messageMenuTrigger{width:30px!important;height:30px!important;font-size:20px!important;}
.bubble:has(.chatMedia),.bubble:has(video.chatMedia){max-width:min(86%,520px)!important;padding:5px!important;}
.bubble .chatMedia,.bubble video.chatMedia{max-width:min(100%,520px,calc(100vw - 92px))!important;max-height:62dvh!important;object-fit:contain!important;}
.composer{min-height:68px!important;gap:9px!important;padding:10px clamp(10px,1.8vw,22px)!important;padding-bottom:max(10px,env(safe-area-inset-bottom))!important;}
.composer input{font-size:16px!important;line-height:1.4!important;min-height:48px!important;padding:12px 15px!important;border-radius:15px!important;}
.composer button,.composer .attachBtn{width:48px!important;min-width:48px!important;height:48px!important;min-height:48px!important;font-size:22px!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;flex:0 0 48px!important;}
.selectionActionBar{display:flex!important;align-items:center!important;gap:clamp(2px,1vw,10px)!important;min-height:62px!important;flex-wrap:nowrap!important;}
.selectionActionBar span{font-size:14px!important;min-width:70px!important;}
.selectionActionBar button{width:42px!important;min-width:42px!important;height:42px!important;min-height:42px!important;padding:6px!important;font-size:20px!important;flex:0 0 42px!important;}
.bubble.messageSelected{outline:3px solid #4db6ff!important;outline-offset:1px!important;filter:brightness(1.1)!important;}
.bubble.messageSelected:before{content:"✓";position:absolute;left:-9px;top:50%;transform:translate(-50%,-50%);width:25px;height:25px;border-radius:50%;display:grid;place-items:center;background:#1689e8;color:#fff;border:2px solid #fff;font-size:14px;font-weight:800;z-index:5;}
@media(max-width:700px){
 .chathead{height:64px!important;min-height:64px!important;flex-basis:64px!important;padding:8px 12px!important;gap:10px!important;}
 .chathead .av,.chathead .profileBtn .av{width:42px!important;height:42px!important;min-width:42px!important;}
 .chatheadTitle b,.chathead b{font-size:16px!important;}
 .chatheadTitle small,.chathead small{font-size:11px!important;}
 .msgs{padding:10px 9px!important;gap:8px!important;}
 .bubble{font-size:16px!important;line-height:1.5!important;max-width:90%!important;padding:10px 12px!important;}
 .bubble .messageText,.bubble .documentLink,.bubble a.linkPreview{font-size:16px!important;line-height:1.5!important;}
 .bubble:has(.chatMedia),.bubble:has(video.chatMedia){max-width:88%!important;}
 .bubble .chatMedia,.bubble video.chatMedia{max-width:min(100%,calc(100vw - 78px))!important;max-height:58dvh!important;}
 .composer{min-height:64px!important;padding:8px 9px!important;padding-bottom:max(8px,env(safe-area-inset-bottom))!important;gap:7px!important;}
 .composer input{font-size:16px!important;min-height:46px!important;padding:11px 13px!important;}
 .composer button,.composer .attachBtn{width:44px!important;min-width:44px!important;height:44px!important;min-height:44px!important;flex-basis:44px!important;font-size:21px!important;}
 .selectionActionBar{gap:1px!important;padding:7px 5px!important;padding-bottom:max(7px,env(safe-area-inset-bottom))!important;min-height:58px!important;}
 .selectionActionBar span{font-size:12px!important;min-width:60px!important;}
 .selectionActionBar button{width:37px!important;min-width:37px!important;height:40px!important;min-height:40px!important;flex-basis:37px!important;padding:4px!important;font-size:18px!important;}
 .top .profileArea strong{font-size:15px!important;}
}
@media(min-width:701px){.chathead{padding-left:18px!important;padding-right:18px!important;}.bubble{max-width:min(78%,800px)!important;}}
.composer[hidden]{display:none!important}


/* Connect With 143: consolidated mobile-first polish (ui4).
   Keep this block last so older experimental rules cannot shrink the chat UI. */
:root{
  --c143-font-body:16px;
  --c143-font-title:17px;
  --c143-font-meta:11px;
  --c143-header-height:68px;
  --c143-composer-height:68px;
  --c143-bubble-max: min(78%, 760px);
}
html,body{width:100%;height:100%;min-height:100%;margin:0;overflow:hidden;font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;-webkit-text-size-adjust:100%;text-size-adjust:100%;overscroll-behavior:none}
body{font-size:16px;line-height:1.45}
.wrap,.phone,#app,.app{width:100%!important;max-width:none!important;height:100vh!important;height:100dvh!important;min-height:0!important;margin:0!important;border-radius:0!important;box-shadow:none!important;overflow:hidden!important}
.wrap{display:block!important}
.app{display:flex!important;flex-direction:column!important}
.top{flex:0 0 var(--c143-header-height)!important;height:var(--c143-header-height)!important;min-height:var(--c143-header-height)!important;padding:8px clamp(10px,2vw,24px)!important;gap:clamp(7px,1.2vw,12px)!important}
.top .iconBtn{min-width:42px;min-height:42px;display:inline-flex;align-items:center;justify-content:center}
.top .av{width:42px!important;height:42px!important;min-width:42px!important}
.top .profileArea strong{font-size:16px!important;line-height:1.3!important;font-weight:650}
.body{flex:1 1 auto!important;min-height:0!important;min-width:0!important;overflow:hidden!important;display:flex!important}
.side{flex:0 0 250px;width:250px;min-width:0;max-width:35vw;overflow:auto;overscroll-behavior:contain}
.chat{flex:1 1 0!important;min-width:0!important;min-height:0!important;width:0;overflow:hidden!important;display:flex!important;flex-direction:column!important}
.chathead{flex:0 0 68px!important;height:68px!important;min-height:68px!important;display:flex!important;align-items:center!important;gap:12px!important;padding:8px clamp(12px,2vw,22px)!important}
.chathead .av,.chathead .profileBtn .av{width:44px!important;height:44px!important;min-width:44px!important;font-size:17px!important}
.chatheadTitle{min-width:0!important;flex:1 1 auto!important}
.chatheadTitle b,.chathead b{font-size:17px!important;line-height:1.25!important;font-weight:650!important;overflow-wrap:anywhere}
.chatheadTitle small,.chathead small{display:block!important;font-size:12px!important;line-height:1.35!important;margin-top:3px!important}
.chathead .callBtn{width:42px;height:42px;min-width:42px;font-size:19px}
.msgs{flex:1 1 auto!important;min-height:0!important;min-width:0!important;overflow-x:hidden!important;overflow-y:auto!important;overscroll-behavior:contain!important;padding:12px clamp(10px,2vw,24px)!important;gap:9px!important;font-size:16px!important;line-height:1.5!important;background-repeat:no-repeat!important;background-size:cover!important;background-position:center!important}
.bubble{position:relative!important;flex:0 0 auto;max-width:var(--c143-bubble-max)!important;min-width:0!important;padding:10px 14px!important;border-radius:15px!important;font-size:16px!important;line-height:1.5!important;overflow-wrap:anywhere!important;word-break:normal!important;touch-action:pan-y!important}
.bubble .messageText,.bubble .documentLink,.bubble a.linkPreview{font-size:16px!important;line-height:1.5!important;overflow-wrap:anywhere}
.bubble .messageFooter{display:flex;align-items:center;justify-content:flex-end;gap:5px;margin-top:5px;font-size:11px!important;line-height:1.25!important}
.bubble .time{font-size:11px!important;line-height:1.2!important;white-space:nowrap}
.bubble .messageMenuTrigger{width:32px!important;height:32px!important;min-width:32px!important;min-height:32px!important;font-size:21px!important;right:4px!important;top:4px!important;touch-action:manipulation!important}
.bubble:has(.chatMedia),.bubble:has(video.chatMedia){width:fit-content;max-width:min(82%,560px)!important;padding:5px!important}
.bubble .chatMedia,.bubble video.chatMedia{display:block!important;width:auto!important;height:auto!important;max-width:min(100%,520px,calc(100vw - 92px))!important;max-height:62dvh!important;object-fit:contain!important;border-radius:10px!important}
.imageOpenBtn,.imageOpenButton{max-width:100%!important;line-height:0!important}
.composer{flex:0 0 auto!important;min-width:0!important;min-height:var(--c143-composer-height)!important;display:flex!important;align-items:center!important;gap:8px!important;padding:9px clamp(9px,1.8vw,22px)!important;padding-bottom:max(9px,env(safe-area-inset-bottom))!important}
.composer input{flex:1 1 auto!important;min-width:0!important;width:0!important;height:48px!important;min-height:48px!important;padding:11px 15px!important;font-size:16px!important;line-height:1.4!important;border-radius:24px!important}
.composer button,.composer .attachBtn{flex:0 0 46px!important;width:46px!important;min-width:46px!important;height:46px!important;min-height:46px!important;padding:0!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;font-size:21px!important;border-radius:50%!important;touch-action:manipulation}
.selectionActionBar{flex:0 0 auto!important;display:flex!important;align-items:center!important;gap:clamp(2px,.8vw,10px)!important;min-height:64px!important;padding:8px clamp(6px,1.5vw,18px)!important;padding-bottom:max(8px,env(safe-area-inset-bottom))!important;background:#f8f9fc!important;color:#1f2937!important;border-top:1px solid #d9dee8!important;box-shadow:0 -5px 18px #0002!important;z-index:30!important;overflow-x:auto!important;overscroll-behavior-x:contain}
.selectionActionBar span{flex:1 0 auto!important;min-width:0!important;font-size:13px!important;font-weight:650!important;white-space:nowrap!important}
.selectionActionBar button{flex:0 0 42px!important;width:42px!important;min-width:42px!important;height:42px!important;min-height:42px!important;padding:5px!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;font-size:20px!important}
.bubble.messageSelected{outline:2px solid #4db6ff!important;outline-offset:1px!important;filter:brightness(1.08)!important}
.bubble.messageSelected:before{left:-7px!important;width:23px!important;height:23px!important;font-size:13px!important}
#modal{z-index:5000!important}
@media(max-width:700px){
  :root{--c143-header-height:58px;--c143-composer-height:62px;--c143-bubble-max:90%}
  .side{position:fixed!important;z-index:80!important;top:58px!important;bottom:0!important;left:0!important;width:min(84vw,320px)!important;max-width:none!important;flex-basis:auto!important;height:auto!important;transition:transform .18s ease!important}
  .side.sidebar-hidden{transform:translateX(-105%)!important;visibility:hidden!important}
  .side.sidebar-visible{transform:translateX(0)!important;visibility:visible!important}
  .sidebar-backdrop:not([hidden]){position:fixed!important;inset:58px 0 0!important;z-index:70!important;background:#0008!important}
  .top{padding:6px 9px!important;gap:7px!important}
  .top .iconBtn{min-width:38px!important;min-height:38px!important;padding:5px!important}
  .top .av{width:38px!important;height:38px!important;min-width:38px!important}
  .top .profileArea strong{font-size:15px!important}
  .chathead{flex-basis:62px!important;height:62px!important;min-height:62px!important;padding:7px 10px!important;gap:9px!important}
  .chathead .av,.chathead .profileBtn .av{width:42px!important;height:42px!important;min-width:42px!important}
  .chatheadTitle b,.chathead b{font-size:16px!important}
  .chatheadTitle small,.chathead small{font-size:11px!important}
  .chathead .callBtn{width:38px;height:38px;min-width:38px;font-size:17px}
  .msgs{padding:9px 8px!important;gap:8px!important}
  .bubble{max-width:90%!important;padding:9px 12px!important;font-size:16px!important;line-height:1.45!important}
  .bubble .messageText,.bubble .documentLink,.bubble a.linkPreview{font-size:16px!important;line-height:1.45!important}
  .bubble:has(.chatMedia),.bubble:has(video.chatMedia){max-width:88%!important}
  .bubble .chatMedia,.bubble video.chatMedia{max-width:min(100%,calc(100vw - 78px))!important;max-height:58dvh!important}
  .composer{gap:6px!important;padding:7px 8px!important;padding-bottom:max(7px,env(safe-area-inset-bottom))!important}
  .composer input{height:46px!important;min-height:46px!important;padding:10px 13px!important}
  .composer button,.composer .attachBtn{flex-basis:43px!important;width:43px!important;min-width:43px!important;height:43px!important;min-height:43px!important;font-size:20px!important}
  .selectionActionBar{gap:2px!important;min-height:58px!important;padding:6px 5px!important;padding-bottom:max(6px,env(safe-area-inset-bottom))!important}
  .selectionActionBar span{font-size:12px!important}
  .selectionActionBar button{flex-basis:38px!important;width:38px!important;min-width:38px!important;height:40px!important;min-height:40px!important;font-size:18px!important}
  .profileHero .largeAvatar{width:112px!important;height:112px!important}
}
@media(min-width:701px){
  .side{flex:0 0 250px!important;width:250px!important;max-width:250px!important}
  .bubble{max-width:min(78%,800px)!important}
  .bubble:has(.chatMedia),.bubble:has(video.chatMedia){max-width:min(70%,560px)!important}
}
.composer[hidden]{display:none!important}
.selectionActionBar[hidden]{display:none!important}


/* Mobile Chrome production parity + personal photo wallpaper picker (2026-10-14). */
html{width:100%;min-width:0;min-height:100%;}
body{width:100%;min-width:0;min-height:100%;margin:0;overflow:hidden;zoom:1;}
.wrap,.phone,#app,.app{width:100%!important;max-width:none!important;min-width:0!important;height:100vh!important;height:100dvh!important;min-height:0!important;margin:0!important;}
@supports(height:100svh){.wrap,.phone,#app,.app{min-height:100svh;}}
@media screen and (max-width:700px){
  .wrap,.phone,#app,.app{width:100%!important;max-width:100%!important;height:100vh!important;height:100dvh!important;border-radius:0!important;box-shadow:none!important;}
  .top{flex-basis:58px!important;height:58px!important;min-height:58px!important;}
  .chathead{flex-basis:62px!important;height:62px!important;min-height:62px!important;}
  .chatheadTitle b,.chathead b{font-size:16px!important;}
  .chatheadTitle small,.chathead small{font-size:12px!important;}
  .bubble,.bubble .messageText,.bubble .documentLink,.bubble a.linkPreview{font-size:16px!important;line-height:1.45!important;}
  .bubble .time,.bubble .messageFooter{font-size:11px!important;}
  .composer input{font-size:16px!important;}
}
.wallpaperGalleryButton{width:100%;min-height:44px;margin:4px 0 8px;padding:10px 12px;border:1px dashed #52678b;border-radius:12px;background:#172238;color:#eaf0ff;font-size:14px;font-weight:650;}
.customWallpaperPreview{min-height:84px;margin:8px 0;border:1px solid #52678b;border-radius:12px;background-color:#0d1422;background-size:cover;background-position:center;display:grid;place-items:center;color:white;text-shadow:0 1px 5px #000;font-size:13px;font-weight:700;overflow:hidden;}
.customWallpaperPreview[hidden]{display:none!important;}


/* 2026-10-14 fixes: true downloads, wallpaper crop confirmation, stable wallpaper and safer back gestures */
#msgs{background-attachment:fixed!important;background-repeat:no-repeat!important;background-position:center center!important;background-size:cover!important;}
html,body,.wrap,.phone,#app,.app,.body,.chat,.msgs{overscroll-behavior-x:none!important;}
body{overscroll-behavior: none!important;}
.chat,.msgs{touch-action:pan-y pinch-zoom;}
.messageDownload,.imageViewerDownload{cursor:pointer;font:inherit;}
.imageViewerDownload{display:inline-flex;align-items:center;justify-content:center;min-height:42px;border:1px solid #ffffff44;cursor:pointer;font-weight:650;}
.wallpaperCropSheet{width:min(94vw,440px)!important;max-height:90dvh;overflow:auto;padding:14px!important;gap:10px!important;}
.wallpaperCropHint{margin:0;color:#aebbd1;font-size:13px;line-height:1.4;}
.wallpaperCropStage{position:relative;width:min(100%,300px);height:min(42dvh,360px);min-height:210px;margin:0 auto;overflow:hidden;border:1px solid #536482;border-radius:12px;background:#080d17;touch-action:none;user-select:none;-webkit-user-select:none;}
.wallpaperCropStage img{position:absolute;max-width:none;max-height:none;object-fit:fill;user-select:none;-webkit-user-drag:none;pointer-events:none;}
.wallpaperZoomRow{display:flex;align-items:center;gap:10px;width:100%;font-size:13px;}
.wallpaperZoomRow label{flex:0 0 auto;color:#dbe5f8;}
.wallpaperZoomRow input{flex:1;min-width:0;accent-color:#5a88ff;}
.wallpaperZoomRow span{min-width:42px;text-align:right;color:#dbe5f8;font-variant-numeric:tabular-nums;}
.wallpaperCropSheet .wallpaperApplyActions button{min-height:44px;font-size:14px;}
@media(max-width:480px){
 .wallpaperCropSheet{width:calc(100vw - 24px)!important;padding:12px!important;}
 .wallpaperCropStage{width:min(100%,270px);height:min(40dvh,320px);min-height:190px;}
 .wallpaperCropSheet .editMessageHeader h3{font-size:17px;}
}

/* 2026-10-14 fixes: true downloads, wallpaper crop confirmation, stable wallpaper and safer back gestures */
#msgs{background-attachment:fixed!important;background-repeat:no-repeat!important;background-position:center center!important;background-size:cover!important;}
html,body,.wrap,.phone,#app,.app,.body,.chat,.msgs{overscroll-behavior-x:none!important;}
body{overscroll-behavior:none!important;}
.chat,.msgs{touch-action:pan-y pinch-zoom;}
.messageDownload,.imageViewerDownload{cursor:pointer;font:inherit;}
.imageViewerDownload{display:inline-flex;align-items:center;justify-content:center;min-height:42px;border:1px solid #ffffff44;cursor:pointer;font-weight:650;}
.wallpaperCropSheet{width:min(94vw,440px)!important;max-height:90dvh;overflow:auto;padding:14px!important;gap:10px!important;}
.wallpaperCropHint{margin:0;color:#aebbd1;font-size:13px;line-height:1.4;}
.wallpaperCropStage{position:relative;width:min(100%,300px);height:min(42dvh,360px);min-height:210px;margin:0 auto;overflow:hidden;border:1px solid #536482;border-radius:12px;background:#080d17;touch-action:none;user-select:none;-webkit-user-select:none;}
.wallpaperCropStage img{position:absolute;max-width:none;max-height:none;object-fit:fill;user-select:none;-webkit-user-drag:none;pointer-events:none;}
.wallpaperZoomRow{display:flex;align-items:center;gap:10px;width:100%;font-size:13px;}
.wallpaperZoomRow label{flex:0 0 auto;color:#dbe5f8;}
.wallpaperZoomRow input{flex:1;min-width:0;accent-color:#5a88ff;}
.wallpaperZoomRow span{min-width:42px;text-align:right;color:#dbe5f8;font-variant-numeric:tabular-nums;}
.wallpaperCropSheet .wallpaperApplyActions button{min-height:44px;font-size:14px;}
@media(max-width:480px){.wallpaperCropSheet{width:calc(100vw - 24px)!important;padding:12px!important;}.wallpaperCropStage{width:min(100%,270px);height:min(40dvh,320px);min-height:190px;}.wallpaperCropSheet .editMessageHeader h3{font-size:17px;}}


/* 2026-10-14 media viewer polish: blurred backdrop, curved glass frame, native video controls. */
#modal{background:rgba(4,8,18,.66)!important;backdrop-filter:blur(13px) saturate(120%);-webkit-backdrop-filter:blur(13px) saturate(120%);}
.msgs{background-attachment:scroll!important;background-repeat:no-repeat!important;background-position:center center!important;background-size:cover!important;}
.mediaViewer{position:fixed;inset:0;z-index:100000;display:none;align-items:center;justify-content:center;padding:clamp(10px,3vw,28px);box-sizing:border-box;background:rgba(4,7,15,.68);backdrop-filter:blur(16px) saturate(125%);-webkit-backdrop-filter:blur(16px) saturate(125%);}
.mediaViewer[style*="display: flex"]{display:flex!important;}
.mediaViewerCard{display:flex;flex-direction:column;width:min(100%,920px);max-height:min(92dvh,980px);min-height:0;overflow:hidden;border:1px solid rgba(255,255,255,.16);border-radius:24px;background:linear-gradient(145deg,rgba(26,36,56,.97),rgba(9,14,25,.98));box-shadow:0 24px 90px rgba(0,0,0,.58),inset 0 1px 0 rgba(255,255,255,.06);}
.mediaViewerTop{display:flex;align-items:center;gap:10px;min-height:58px;padding:8px 12px 8px 18px;border-bottom:1px solid rgba(255,255,255,.1);color:#f4f7ff;}
.mediaViewerTitle{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px;font-weight:650;}
.mediaViewerDownload,.mediaViewer .imageViewerClose{position:static;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;min-height:38px;padding:8px 12px;border:1px solid rgba(255,255,255,.14);border-radius:12px;background:rgba(255,255,255,.08);color:#f4f7ff;font-size:13px;font-weight:650;cursor:pointer;}
.mediaViewer .imageViewerClose{width:40px;min-width:40px;padding:0;font-size:26px;line-height:1;}
.mediaViewerStage{display:flex;align-items:center;justify-content:center;min-height:0;overflow:auto;padding:12px;background:radial-gradient(ellipse at 50% 0%,rgba(72,103,166,.15),transparent 58%);}
.mediaViewerStage img{display:block;max-width:100%;max-height:calc(92dvh - 100px);width:auto;height:auto;object-fit:contain;border-radius:14px;box-shadow:0 12px 40px rgba(0,0,0,.3);}
.mediaViewerStage video{display:block;width:auto;height:auto;max-width:100%;max-height:calc(92dvh - 100px);object-fit:contain;border-radius:14px;background:#000;box-shadow:0 12px 40px rgba(0,0,0,.35);}
@media(max-width:600px){.mediaViewer{padding:10px}.mediaViewerCard{width:100%;max-height:calc(100dvh - 20px);border-radius:20px}.mediaViewerTop{min-height:54px;padding:7px 9px 7px 13px;gap:7px}.mediaViewerTitle{font-size:13px}.mediaViewerDownload{min-height:36px;padding:7px 9px;font-size:12px}.mediaViewer .imageViewerClose{width:36px;min-width:36px;min-height:36px;border-radius:11px}.mediaViewerStage{padding:8px}.mediaViewerStage img,.mediaViewerStage video{max-height:calc(100dvh - 94px);border-radius:12px}}


/* TujhyaSathi/Fakt Tujhyasathi splash branding. Keep text as HTML for crisp bilingual rendering. */
.login.splashLogin{position:relative;isolation:isolate;background:#10122e url('/images/tujhyasathi-splash.webp') center center/cover no-repeat!important;padding:clamp(16px,4vw,36px)!important;}
.login.splashLogin::before{content:"";position:absolute;inset:0;z-index:-1;background:linear-gradient(180deg,rgba(7,10,30,.12),rgba(7,10,25,.35) 48%,rgba(4,7,20,.76));}
.splashCard{width:min(100%,420px)!important;text-align:center;background:rgba(18,16,35,.86)!important;border-color:rgba(255,255,255,.16)!important;box-shadow:0 22px 80px rgba(0,0,0,.38)!important;padding:clamp(20px,3vw,30px)!important;backdrop-filter:blur(15px)!important;}
.brandWordmark h1{font-size:clamp(24px,4vw,34px);line-height:1.12;margin:0 0 5px!important;color:#fff8f4;letter-spacing:-.03em;}
.brandMarathi{font-size:clamp(20px,3.5vw,27px);font-weight:750;color:#ffd2b9;line-height:1.35;}
.brandTagline{margin:14px 0 22px;color:#fff;font-size:15px;font-weight:650;}
.splashCard .primary{background:linear-gradient(100deg,#ff835e,#ffb53f)!important;color:#201323!important;}
.splashCard .switch{color:#fff1e9!important;background:rgba(255,255,255,.07)!important;border-color:rgba(255,255,255,.2)!important;}
.splashCard .hint{color:#d5d6e4!important;}
.linkPreview{display:flex!important;align-items:stretch;gap:0;padding:0!important;max-width:min(360px,100%)!important;overflow:hidden;background:rgba(12,20,37,.16);border-radius:12px!important;text-decoration:none!important;}
.linkPreviewThumb{flex:0 0 104px;width:104px;min-height:84px;background-color:#202b40;background-size:cover;background-position:center;background-repeat:no-repeat;}
.linkPreviewThumb[hidden]{display:none!important;}
.linkPreviewText{display:flex;flex:1;min-width:0;flex-direction:column;justify-content:center;padding:10px 12px;gap:4px;}
.linkPreviewTitle{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px!important;line-height:1.3!important;margin:0!important;}
.linkPreviewDescription{display:-webkit-box!important;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere;font-size:12px;line-height:1.35;opacity:.82;}
.linkPreviewDomain{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10px;opacity:.72;margin-top:2px;}
@media(max-width:520px){.linkPreview{max-width:min(300px,100%)!important}.linkPreviewThumb{flex-basis:82px;width:82px;min-height:76px}.linkPreviewText{padding:8px 9px}.linkPreviewTitle{font-size:13px!important}.linkPreviewDescription{font-size:11px;}}


/* 2026-10-15 Tujhyasathi romantic indigo + sunset theme polish */
:root{
  --love-night:#17182f;
  --love-indigo:#29284d;
  --love-purple:#40365f;
  --love-coral:#ff765f;
  --love-peach:#ffc09a;
  --love-amber:#ffb94e;
  --love-border:rgba(255,190,160,.14);
  --love-muted:#c3bfd4;
}
html,body{background:#17182f!important;color:#f8f3f4;}
.phone{background:#17182f!important;}
.app,.top,.composer{background:rgba(20,20,43,.98)!important;border-color:rgba(255,190,160,.12)!important;}
.top,.chathead,.composer{border-color:rgba(255,190,160,.13)!important;}
.chathead .profileArea small{color:#ffb49b!important;}
.iconBtn,.callBtn,.composer .attachBtn{background:rgba(58,53,87,.72)!important;border-color:rgba(255,203,173,.15)!important;color:#fff3ec!important;}
.av{background:linear-gradient(135deg,#ff8b6d,#ffc36c 52%,#68558e)!important;}
.primary,.add,.composer button:not(.attachBtn){background:linear-gradient(110deg,#ff765f,#ffb94e)!important;color:#241b31!important;box-shadow:0 3px 12px rgba(255,118,95,.13)!important;}
.switch,.close{border-color:rgba(255,190,160,.18)!important;color:#ffd0b9!important;}
.msgs{background-color:#191a35!important;}
.bubble{background:rgba(43,42,72,.94)!important;border:1px solid rgba(255,210,185,.10)!important;box-shadow:none!important;color:#f8f3f4!important;border-radius:16px!important;}
.bubble.mine{background:linear-gradient(135deg,rgba(69,54,94,.98),rgba(87,52,83,.98))!important;border:1px solid rgba(255,190,160,.18)!important;color:#fff6f1!important;}
.bubble:has(.chatMedia),.bubble:has(video.chatMedia){background:rgba(37,34,64,.92)!important;border:1px solid rgba(255,196,165,.16)!important;padding:4px!important;}
.bubble .chatMedia,.bubble video.chatMedia{border-radius:11px!important;outline:0!important;box-shadow:none!important;}
.bubble .time,.bubble .messageFooter{color:#e2c6ca!important;}
.bubble .messageText a:not(.linkPreview){color:#ffd0a7!important;}
.bubble.messageSelected{outline:2px solid rgba(255,151,117,.85)!important;outline-offset:2px!important;filter:none!important;}
.bubble.messageSelected:before{background:#ff8b6d!important;border:2px solid #292044!important;color:#24172e!important;}
.selectionActionBar{background:#24213f!important;color:#fff4ee!important;border-color:rgba(255,190,160,.16)!important;box-shadow:0 -5px 18px rgba(0,0,0,.18)!important;}
.selectionActionBar button{color:#ffe9dd!important;}
.selectionActionBar button.selectionDelete{background:#b74751!important;color:#fff!important;}
.composer input{background:#111329!important;border-color:rgba(255,190,160,.18)!important;color:#fff6f1!important;}
.composer input::placeholder{color:#aaa4bc!important;}
.linkPreview{max-width:min(310px,100%)!important;min-width:0!important;background:rgba(24,22,48,.76)!important;border:1px solid rgba(255,190,160,.13)!important;border-radius:11px!important;box-shadow:none!important;color:#fff1e9!important;}
.linkPreviewThumb{flex:0 0 76px!important;width:76px!important;min-height:66px!important;background-color:#292744!important;}
.linkPreviewText{padding:7px 9px!important;gap:3px!important;}
.linkPreviewTitle{color:#ffe2d2!important;font-size:13px!important;line-height:1.25!important;}
.linkPreviewDescription{color:#d5ccdf!important;font-size:11px!important;line-height:1.3!important;}
.linkPreviewDomain{color:#ffb58f!important;font-size:10px!important;margin-top:1px!important;}
.bubble .linkPreview{margin:2px 0!important;}
.bubble:has(.linkPreview){padding:7px 9px!important;}
.bubble:has(.linkPreview) .messageFooter{margin-top:3px!important;}
@media(max-width:520px){
 .linkPreview{max-width:min(270px,100%)!important;}
 .linkPreviewThumb{flex-basis:66px!important;width:66px!important;min-height:60px!important;}
 .linkPreviewText{padding:6px 8px!important;}
 .linkPreviewTitle{font-size:12px!important;}
 .linkPreviewDescription{font-size:10px!important;-webkit-line-clamp:2!important;}
 .bubble:has(.linkPreview){padding:6px 8px!important;}
}


/* Fakt Tujhyasathi premium icon system + elegant call chooser */
.uiIcon{display:block;flex:0 0 auto;width:1.2em;height:1.2em;stroke:currentColor;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round;transition:transform .18s ease,color .18s ease;}
.iconBtn,.callBtn,.attachBtn,.sendMessageBtn,.profileQuickActions button,.sideActions button{display:inline-flex!important;align-items:center;justify-content:center;gap:8px;}
.iconBtn .uiIcon,.callBtn .uiIcon,.attachBtn .uiIcon,.sendMessageBtn .uiIcon,.profileQuickActions .uiIcon,.sideActions .uiIcon{width:20px;height:20px;}
.iconBtn{width:42px;height:42px;padding:0!important;border-radius:14px!important;background:rgba(43,39,73,.62)!important;border:1px solid rgba(255,199,174,.12)!important;color:#f7e9eb!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.035)!important;transition:background .18s ease,border-color .18s ease,transform .18s ease!important;}
.iconBtn:hover{background:rgba(74,57,91,.78)!important;border-color:rgba(255,184,151,.28)!important;transform:translateY(-1px);}
.callMenuWrap{position:relative!important;display:inline-flex!important;}
.chathead .callBtn.callMenuTrigger{position:relative!important;isolation:isolate;width:48px!important;height:48px!important;min-width:48px!important;border-radius:17px!important;border:1px solid rgba(128,255,185,.24)!important;background:radial-gradient(circle at 28% 18%,rgba(74,175,121,.25),transparent 56%),linear-gradient(145deg,#202d39,#171a2b 70%)!important;color:#a9ffc0!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.08),0 5px 18px rgba(4,10,18,.22)!important;display:grid!important;place-items:center!important;overflow:hidden;}
.chathead .callBtn.callMenuTrigger:before{content:"";position:absolute;inset:4px;border-radius:12px;border:1px solid rgba(125,255,173,.11);pointer-events:none;}
.chathead .callBtn.callMenuTrigger .uiIcon{width:25px;height:25px;position:relative;z-index:1;stroke-width:1.8;}
.callButtonGlow{position:absolute;z-index:-1;width:30px;height:30px;border-radius:50%;background:#66f29a;filter:blur(19px);opacity:.18;pointer-events:none;}
.chathead .callBtn.callMenuTrigger:hover{transform:translateY(-1px);border-color:rgba(135,255,183,.5)!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 0 0 3px rgba(104,245,157,.055),0 8px 22px rgba(4,10,18,.32)!important;}
.callMenu{position:absolute!important;right:0!important;top:calc(100% + 12px)!important;z-index:1500!important;width:min(318px,calc(100vw - 28px))!important;min-width:286px!important;padding:10px!important;border-radius:20px!important;background:linear-gradient(145deg,rgba(33,33,59,.98),rgba(21,22,40,.99))!important;color:#fff3ef!important;border:1px solid rgba(255,190,160,.19)!important;box-shadow:0 20px 54px rgba(0,0,0,.46),inset 0 1px 0 rgba(255,255,255,.055)!important;backdrop-filter:blur(22px)!important;white-space:normal!important;transform-origin:top right;animation:callMenuEnter .16s ease-out both;}
.callMenu[hidden]{display:none!important;}
.callMenuEyebrow{padding:7px 10px 9px;color:#d8a991;font-size:9px;font-weight:800;letter-spacing:2.2px;}
.callMenu button{display:flex!important;align-items:center!important;gap:12px!important;width:100%!important;min-height:72px!important;padding:10px!important;border:1px solid transparent!important;border-radius:14px!important;background:transparent!important;color:#fff5f0!important;text-align:left!important;white-space:normal!important;transition:background .18s ease,border-color .18s ease,transform .18s ease!important;}
.callMenu button+button{margin-top:4px!important;}
.callMenu button:hover{background:rgba(255,255,255,.045)!important;border-color:rgba(255,190,160,.12)!important;transform:translateX(1px);}
.callOptionIcon{display:grid;place-items:center;flex:0 0 48px;width:48px;height:48px;border-radius:15px;border:1px solid rgba(255,255,255,.1);}
.callOptionIcon .uiIcon{width:23px;height:23px;}
.callOptionIcon.videoOption{color:#a7ffc0;background:radial-gradient(circle at 30% 20%,rgba(101,255,153,.2),transparent 75%),linear-gradient(145deg,rgba(38,91,65,.72),rgba(23,42,45,.85));border-color:rgba(122,255,175,.25);}
.callOptionIcon.voiceOption{color:#ffc19f;background:radial-gradient(circle at 30% 20%,rgba(255,170,131,.19),transparent 75%),linear-gradient(145deg,rgba(103,56,71,.7),rgba(48,34,57,.85));border-color:rgba(255,184,151,.22);}
.callOptionCopy{display:flex;flex:1;min-width:0;flex-direction:column;gap:5px;}
.callOptionCopy b{font-size:14px;font-weight:750;letter-spacing:.1px;color:#fff6f1;}
.callOptionCopy small{font-size:10px;line-height:1.35;color:#bcb4c9;font-weight:450;}
.callMenu button>.uiIcon{color:#8f879f;}
@keyframes callMenuEnter{from{opacity:0;transform:translateY(-4px) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}
.composer .attachBtn{width:46px;min-width:46px;height:46px;border-radius:16px!important;background:rgba(43,39,73,.62)!important;border:1px solid rgba(255,199,174,.12)!important;color:#f5d4c9!important;}
.composer .sendMessageBtn{width:46px;min-width:46px;height:46px;border-radius:16px!important;background:linear-gradient(145deg,#ff9a80,#ffc27f)!important;color:#30243c!important;box-shadow:0 5px 15px rgba(255,130,107,.16)!important;}
.composer .sendMessageBtn .uiIcon{width:21px;height:21px;}
.profileQuickActions button{background:rgba(54,47,80,.68)!important;border:1px solid rgba(255,190,160,.12)!important;color:#ffd1bd!important;}
.profileQuickActions button:hover{background:rgba(78,57,89,.82)!important;border-color:rgba(255,190,160,.25)!important;}
.profileQuickActions .uiIcon{width:23px;height:23px;}
.profileMediaIcon .uiIcon{width:22px;height:22px;}
@media(max-width:430px){.chathead .callBtn.callMenuTrigger{width:44px!important;height:44px!important;min-width:44px!important;border-radius:15px!important}.callMenu{right:0!important;width:min(300px,calc(100vw - 22px))!important;min-width:0!important}.callMenu button{min-height:68px!important}.callOptionIcon{width:44px;height:44px;flex-basis:44px}}
.callControls button{display:inline-flex;align-items:center;justify-content:center;gap:8px;}
.callControls button .uiIcon{width:18px;height:18px;}
.voicePulse .uiIcon{width:32px;height:32px;stroke-width:1.8;}


/* Tujhyasathi UI fix v2 — keep chat message menus behind the active call */
#callLayer{z-index:99990!important;}
#callLayer:not(:empty){isolation:isolate!important;}
.callShade{z-index:99999!important;}
body:has(#callLayer:not(:empty)) .messageMenuTrigger,
body:has(#callLayer:not(:empty)) .messageMenu{display:none!important;}

/* Compact responsive link preview cards: prevent the containing bubble from stretching */
.bubble:has(.linkPreview){
  width:fit-content!important;
  max-width:min(340px,calc(100vw - 88px))!important;
  min-width:0!important;
  flex:0 1 auto!important;
  align-self:flex-start!important;
  box-sizing:border-box!important;
  padding:7px 8px!important;
}
.bubble a.linkPreview{
  display:flex!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  box-sizing:border-box!important;
  margin:0!important;
  overflow:hidden!important;
}
.bubble:has(.linkPreview) .linkPreviewText{min-width:0!important;overflow:hidden!important;}
.bubble:has(.linkPreview) .linkPreviewTitle,
.bubble:has(.linkPreview) .linkPreviewDescription,
.bubble:has(.linkPreview) .linkPreviewDomain{max-width:100%!important;overflow-wrap:anywhere!important;}
@media(max-width:600px){
  .bubble:has(.linkPreview){max-width:min(300px,calc(100vw - 82px))!important;padding:6px 7px!important;}
  .bubble:has(.linkPreview) .linkPreviewThumb{flex-basis:64px!important;width:64px!important;min-height:58px!important;}
  .bubble:has(.linkPreview) .linkPreviewText{padding:6px 8px!important;}
}

/* Preserve right alignment for the current user's link previews */
.bubble.mine:has(.linkPreview){align-self:flex-end!important;}


/* Tujhyasathi UI fix v3 — let short text messages size to their content, not the full chat column. */
.bubble:not(:has(.chatMedia)):not(:has(video.chatMedia)):not(:has(.linkPreview)){
  display:block!important;
  width:fit-content!important;
  max-width:min(72%,640px)!important;
  flex:0 1 auto!important;
  align-self:flex-start!important;
  box-sizing:border-box!important;
}
.bubble.mine:not(:has(.chatMedia)):not(:has(video.chatMedia)):not(:has(.linkPreview)){
  align-self:flex-end!important;
}
@media(max-width:700px){
  .bubble:not(:has(.chatMedia)):not(:has(video.chatMedia)):not(:has(.linkPreview)){
    max-width:min(84%,520px)!important;
  }
}
@media(max-width:430px){
  .bubble:not(:has(.chatMedia)):not(:has(video.chatMedia)):not(:has(.linkPreview)){
    max-width:88%!important;
  }
}
