/* UC2 Mobile 2026-10-30 + desktop app-install discovery 2026-10-31. */
:root{--uc-mobile-height:100dvh}
#ucInstallMobileBtn{display:none}
@media (max-width:780px){
 html,body{height:100%;min-width:0;width:100%;max-width:100%;overflow:hidden}
 body{position:relative;overscroll-behavior:none}
 #ucShell,#ucMain,#app{height:var(--uc-mobile-height,100dvh)!important;max-width:100vw;width:100%;min-width:0;min-height:0;overflow:hidden}
 #ucMain{flex:1 1 auto}
 #app{display:flex;flex-direction:column}
 .uc-mobile-top{display:flex;gap:9px;min-height:54px;padding:calc(4px + env(safe-area-inset-top,0px)) 10px 6px;position:relative;z-index:6}
 .uc-mobile-top button{width:44px;min-width:44px;height:44px;border-radius:9px;font-size:22px;display:flex;align-items:center;justify-content:center}
 #ucChatTypeLabel{flex:1;font-size:13px;font-weight:600;min-width:0;text-overflow:ellipsis}
 #ucMobileSyncStatus{font-family:var(--fs);font-size:11px;color:#7cbdab;white-space:nowrap;max-width:105px;overflow:hidden;text-overflow:ellipsis;flex-shrink:0}
 #ucMobileSyncStatus.offline{color:#f3b46f}
 #ucSidebar{position:fixed;inset:0 auto 0 0!important;left:0!important;right:auto!important;height:var(--uc-mobile-height,100dvh)!important;width:min(88vw,350px)!important;flex:0 0 auto!important;transform:translateX(-105%);transition:transform .22s ease!important;padding:calc(9px + env(safe-area-inset-top,0px)) 9px calc(10px + env(safe-area-inset-bottom,0px));z-index:111;box-shadow:12px 0 38px #0008}
 body.uc-sidebar-open #ucSidebar{transform:translateX(0)}
 #ucSidebarBackdrop{z-index:109!important}
 .uc-brand{min-height:52px}
 .uc-new,.uc-nav button{min-height:44px;font-size:14px}
 .uc-recent{min-height:44px;font-size:13px}
 .uc-chat-edit,.uc-chat-delete{width:35px;height:41px;font-size:14px;opacity:1}
 .uc-section{font-size:11px;margin-top:3px}
 .uc-sidebar-bottom{padding-bottom:env(safe-area-inset-bottom,0px)}
 #ucInstallMobileBtn{display:flex!important;align-items:center;justify-content:flex-start}
 .hdr{padding:5px 9px;min-height:43px;overflow-x:auto;overflow-y:hidden;flex-wrap:nowrap;justify-content:flex-start;scrollbar-width:none;-webkit-overflow-scrolling:touch;min-width:0}
 .hdr::-webkit-scrollbar{display:none}
 .hdr-r{flex-wrap:nowrap;display:flex;gap:6px;flex-shrink:0;white-space:nowrap}
 .hdr-r>.btn{min-height:35px;flex-shrink:0}
 .hdr-r .bdg{font-size:11px;flex-shrink:0}
 .prbar{min-height:42px;padding:6px 10px;-webkit-overflow-scrolling:touch;scroll-snap-type:x proximity}
 .prbar .pb{font-size:12px;padding:6px 11px;scroll-snap-align:start}
 #wsStrip{padding:5px 9px;gap:10px;-webkit-overflow-scrolling:touch}
 #chat{min-height:0;flex:1 1 auto;overflow-x:hidden;overflow-y:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;scrollbar-width:thin;padding:14px 8px 22px;gap:20px;scroll-padding-bottom:55px}
 .msg{max-width:100%;width:100%;gap:7px;flex-shrink:0;margin-bottom:6px;min-width:0}
 .msg-a{justify-content:flex-start}
 .msg-u{justify-content:flex-start}
 .msg .bub{max-width:calc(100% - 40px);min-width:0;font-size:15px;line-height:1.65;padding:10px 11px;border-radius:11px;overflow-wrap:anywhere}
 .av{width:28px;height:28px;min-width:28px;margin-top:3px}
 .msg-actions{opacity:1!important;pointer-events:auto!important;bottom:-20px;gap:5px;max-width:calc(100% - 43px)}
 .msg-actions .macb{font-size:11px;min-height:27px;padding:4px 8px}
 .msg-u .msg-actions{right:34px}
 .msg-a .msg-actions{left:35px}
 .bar{flex-shrink:0;z-index:4;padding-bottom:max(5px,env(safe-area-inset-bottom,0px));background:#121525}
 .ccrow{padding:6px 10px 0}
 .ctxt{font-size:11px}
 .binn{padding:7px 8px 6px;gap:8px;align-items:flex-end}
 #inp{min-width:0;flex:1 1 auto;border-radius:13px;font-size:16px!important;line-height:1.45;padding:11px 12px;min-height:46px;max-height:min(27dvh,170px)}
 #sbtn{width:46px;min-width:46px;height:46px;min-height:46px;font-size:17px}
 #ucSceneTools{padding:3px 9px 0!important;gap:5px!important;max-height:50px;overflow-y:auto}
 #ucSceneTools span{font-size:10px!important}
 #npcWarn{padding:5px 9px;gap:6px;flex-wrap:wrap;font-size:12px}
 #empty{padding:16px 12px;max-width:100%}
 #empty h2{font-size:15px}
 #empty p{font-size:13px;line-height:1.6}
 .ov{padding:calc(7px + env(safe-area-inset-top,0px)) 7px calc(7px + env(safe-area-inset-bottom,0px));align-items:stretch;justify-content:center;overflow:hidden}
 .pan,.pan.w{min-width:0;max-width:100%;width:100%;max-height:100%;overflow-y:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;padding:14px 12px;gap:12px;border-radius:13px}
 .h2row{gap:9px;flex-shrink:0}
 .h2row .xbtn{min-width:40px;min-height:40px;font-size:15px}
 .sg input,.sg select,.sg textarea,.gal-search,.adm-inp,.edit-ta{font-size:16px!important;min-height:41px}
 .sg{min-width:0}
 .sg>div{min-width:0}
 .sg input{min-width:0}
 .gal-nav{overflow-x:auto;overflow-y:hidden;flex-wrap:nowrap;-webkit-overflow-scrolling:touch;scrollbar-width:thin;padding:3px 0 8px;max-width:100%}
 .gal-nav .gn,.gal-nav .pb{flex-shrink:0;min-height:35px;padding:7px 12px;font-size:12px}
 .cgrid{grid-template-columns:repeat(2,minmax(0,1fr));max-height:calc(var(--uc-mobile-height,100dvh) - 255px);gap:9px;padding:2px}
 .cc{padding:8px;min-width:0}
 .cc-img-wrap{height:125px}
 .cc-desc{font-size:11px}
 .cn{font-size:12px}
 .cbtns .btn{font-size:11px;min-height:31px}
 .sbtns .btn{min-height:42px}
 #slist{max-height:calc(var(--uc-mobile-height,100dvh) - 185px)}
 .uc-search-row{align-items:flex-start;flex-wrap:wrap;gap:5px;padding:10px 2px}
 .uc-search-main{flex:1 1 180px;min-height:40px}
 .uc-search-actions{max-width:100%;flex-wrap:wrap;gap:5px}
 .uc-search-actions .btn{min-height:36px}
 #ovUpgrade{padding:4px}
 #ovUpgrade .pan{max-height:calc(var(--uc-mobile-height,100dvh) - 9px);padding:12px}
 #ovUpgrade .uc-plans .shell{padding:15px 7px 35px}
 #ovUpgrade .uc-plans .intro{margin:22px auto 22px}
 #ovUpgrade .uc-plans .topline{flex-wrap:wrap}
 #ovUpgrade .uc-plans .comparison{padding:12px 9px}
 #ovUpgrade .uc-plans .tablewrap{max-width:100%;overflow:auto}
 .adm-hdr{padding:9px 10px}
 .adm-tabs{padding:7px 8px}
 .adm-body{padding:12px 9px;max-width:100%}
 .adm-tbl-w{max-width:100%;overflow-x:auto}
 .adm-tab{min-height:40px}
 #ovLightbox .pan{max-height:100%}
}
@media (max-width:390px){
 .cgrid{grid-template-columns:1fr;max-height:calc(var(--uc-mobile-height,100dvh) - 245px)}
 .cc-img-wrap{height:165px}
 .msg .bub{font-size:14.5px}
 .uc-mobile-top{gap:6px}
 #ucMobileSyncStatus{max-width:72px}
 #ovUpgrade .uc-plans .cardpad{padding:18px 15px 10px}
 #ovUpgrade .uc-plans .sections{padding:12px 15px 20px}
}
@media (max-width:780px) and (orientation:landscape){
 .uc-mobile-top{min-height:45px;padding-top:2px;padding-bottom:2px}
 .uc-mobile-top button{height:39px;min-height:39px}
 .hdr{min-height:34px;padding-top:2px;padding-bottom:2px}
 .prbar{min-height:36px;padding-top:3px;padding-bottom:3px}
 .bar{padding-bottom:max(2px,env(safe-area-inset-bottom,0px))}
 #chat{padding-top:6px;padding-bottom:12px}
}

/* ── Discoverability dell'app: DESKTOP e dialog condiviso ── */
#ucDesktopInstallBtn{display:none;width:100%;padding:12px 10px;margin:-1px 0 11px;border-radius:10px;border:1px solid rgba(201,169,110,.6);background:linear-gradient(135deg,rgba(201,169,110,.17),rgba(167,139,250,.11));color:#f6e2b5;cursor:pointer;text-align:left;flex-direction:column;align-items:flex-start;gap:3px;box-shadow:0 1px 14px rgba(201,169,110,.08);font-family:var(--fs);transition:border-color .2s,background .2s}
#ucDesktopInstallBtn:hover,#ucDesktopInstallBtn:focus-visible{background:linear-gradient(135deg,rgba(201,169,110,.24),rgba(167,139,250,.2));border-color:#e7be77;outline:none}
#ucDesktopInstallBtn .uc-app-cta-title{font-size:13px;font-weight:bold;letter-spacing:.4px}
#ucDesktopInstallBtn .uc-app-cta-sub{font-size:11px;color:#b0a8c7;line-height:1.4}
@media(min-width:781px){#ucDesktopInstallBtn{display:flex}}
body.uc-app-dialog-open{overflow:hidden}
.uc-app-dialog-overlay{position:fixed;inset:0;z-index:9999;display:flex;justify-content:center;align-items:center;padding:14px;background:rgba(4,6,19,.88);backdrop-filter:blur(8px)}
.uc-app-dialog{position:relative;width:min(100%,610px);max-height:min(92vh,850px);overflow-y:auto;border-radius:17px;background:linear-gradient(155deg,#1c1930,#111426 70%);border:1px solid rgba(201,169,110,.42);box-shadow:0 26px 85px #000b;padding:27px;color:var(--tx);font-family:var(--fs)}
.uc-app-dialog-close{position:absolute;top:12px;right:13px;display:flex;justify-content:center;align-items:center;width:34px;height:34px;border-radius:8px;border:1px solid #3a3655;background:#1a1b30;color:#ddd;cursor:pointer}
.uc-app-dialog-label{color:#b7a7e7;letter-spacing:1.7px;font-size:10px;font-weight:bold;margin-bottom:8px}
.uc-app-dialog h2{font-size:22px;color:#f2d397;font-family:var(--ft);margin:0 0 10px}
.uc-app-dialog-lead{color:#c0c0d5;line-height:1.6;font-size:14px;margin-bottom:18px;max-width:480px}
.uc-app-dialog-lead strong{color:#f2d397}
.uc-app-dialog-body{display:flex;gap:22px;align-items:center;margin-bottom:17px}
.uc-app-dialog-qr{display:flex;flex-direction:column;gap:8px;align-items:center;flex:0 0 174px;padding:12px;border-radius:12px;border:1px solid #38314d;background:#191b2c}
.uc-app-dialog-qr[hidden]{display:none!important}
.uc-app-dialog-qr img{background:white;border-radius:7px;padding:5px;max-width:100%;object-fit:contain}
.uc-app-dialog-qr span{font-size:11px;color:#bdb8d3;text-align:center}
.uc-app-dialog-instructions{flex:1;min-width:0;display:flex;flex-direction:column;gap:15px}
.uc-app-dialog-instructions strong{font-size:14px;color:#e6c892}
.uc-app-dialog-instructions p{font-size:13px;line-height:1.55;color:#c2c1d4;margin-top:6px}
.uc-app-dialog-instructions b{color:#fff}
.uc-app-dialog-link{display:flex;flex-direction:column;gap:6px;padding:10px 12px;background:#0c1022;border:1px solid #33304c;border-radius:9px;margin-bottom:12px;min-width:0}
.uc-app-dialog-link span{font-size:11px;color:#b1a7c2}
.uc-app-dialog-link code{font-family:ui-monospace,Consolas,monospace;font-size:12px;overflow-wrap:anywhere;color:#f5e2bb}
.uc-app-dialog-buttons{display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap}
.uc-app-dialog-buttons button{border-radius:8px;border:1px solid #54446b;padding:10px 16px;background:#24213a;color:#f2e9ff;font-family:var(--fs);cursor:pointer;font-size:12px}
.uc-app-dialog-buttons .uc-app-copy{background:linear-gradient(135deg,#b18a4b,#d8b46f);border-color:#d8b46f;color:#17111a;font-weight:bold}
.uc-app-dialog-foot{font-size:11px;color:#9c9bb8;line-height:1.5;margin-top:17px}
@media(max-width:560px){.uc-app-dialog{padding:22px 15px}.uc-app-dialog-body{flex-direction:column;gap:15px}.uc-app-dialog-qr{flex-basis:auto}.uc-app-dialog h2{font-size:19px}.uc-app-dialog-lead{font-size:13px}.uc-app-dialog-instructions{gap:13px;width:100%}}
