/* Rabbit Workspace OS — Project Phoenix Sprint 2.0.2
   Smart Mail compact + isolamento assoluto della Home. */

/* La Hero e il centro azioni appartengono esclusivamente alla view Home.
   Il dataset viene sincronizzato dal relativo fix JS, anche quando una vecchia
   routine lascia accidentalmente più view con classe active. */
body[data-rabbit-home-visible="false"] #home,
body[data-rabbit-home-visible="false"] #home.view,
body[data-rabbit-home-visible="false"] #home.view.active{
  display:none!important;
}

/* Difesa generale: una view non attiva non deve mai entrare nel layout. */
.main>.view:not(.active){
  display:none!important;
}

/* Smart Mail Console: altezza contenuta e contenuti interni scrollabili. */
@media (min-width:761px){
  #home #phoenixSmartMailV2 .px2-titlebar{
    padding:18px 21px!important;
    gap:18px!important;
  }
  #home #phoenixSmartMailV2 .px2-titlebar h2{
    margin:5px 0 3px!important;
    font-size:25px!important;
  }
  #home #phoenixSmartMailV2 .px2-titlebar p{
    font-size:10.5px!important;
  }
  #home #phoenixSmartMailV2 .px2-title-actions>span{
    padding:7px 10px!important;
  }
  #home #phoenixSmartMailV2 .px2-title-actions button{
    min-height:36px!important;
  }
  #home #phoenixSmartMailV2 .px2-workspace{
    height:clamp(410px,48vh,470px)!important;
    min-height:0!important;
  }
  #home #phoenixSmartMailV2 .px2-list-panel,
  #home #phoenixSmartMailV2 .px2-detail-panel{
    min-height:0!important;
    max-height:470px!important;
  }
  #home #phoenixSmartMailV2 .px2-detail-panel{
    overflow:auto!important;
    overscroll-behavior:contain;
    scrollbar-gutter:stable;
    padding:13px!important;
  }
  #home #phoenixSmartMailV2 .px2-mail-list{
    min-height:0!important;
    overflow:auto!important;
    overscroll-behavior:contain;
  }
  #home #phoenixSmartMailV2 .px2-list-head{
    padding:10px!important;
  }
  #home #phoenixSmartMailV2 .px2-list-head input{
    height:36px!important;
  }
  #home #phoenixSmartMailV2 .px2-mail-row{
    grid-template-columns:36px minmax(0,1fr) auto!important;
    gap:8px!important;
    padding:8px 9px!important;
    border-radius:15px!important;
  }
  #home #phoenixSmartMailV2 .px2-avatar{
    width:36px!important;
    height:36px!important;
    border-radius:12px!important;
  }
  #home #phoenixSmartMailV2 .px2-open-desk{
    min-height:36px!important;
    margin:8px 10px 10px!important;
  }
  #home #phoenixSmartMailV2 .px2-detail-shell{
    gap:9px!important;
  }
  #home #phoenixSmartMailV2 .px2-detail-head{
    gap:10px!important;
    padding-bottom:9px!important;
  }
  #home #phoenixSmartMailV2 .px2-detail-head h3{
    margin:3px 0 2px!important;
    font-size:18px!important;
  }
  #home #phoenixSmartMailV2 .px2-refresh-ai{
    min-height:34px!important;
  }
  #home #phoenixSmartMailV2 .px2-summary{
    gap:9px!important;
    padding:11px!important;
    border-radius:16px!important;
  }
  #home #phoenixSmartMailV2 .px2-summary p{
    line-height:1.4!important;
    font-size:10px!important;
  }
  #home #phoenixSmartMailV2 .px2-insight-grid{
    gap:7px!important;
  }
  #home #phoenixSmartMailV2 .px2-insight-card{
    padding:10px!important;
    border-radius:15px!important;
  }
  #home #phoenixSmartMailV2 .px2-insight-card>b,
  #home #phoenixSmartMailV2 .px2-insight-card header b{
    margin-bottom:6px!important;
  }
  #home #phoenixSmartMailV2 .px2-tasks>div{
    gap:5px!important;
  }
  #home #phoenixSmartMailV2 .px2-tasks label{
    padding:6px 7px!important;
  }
  #home #phoenixSmartMailV2 .px2-reply{
    padding:10px!important;
    border-radius:16px!important;
  }
  #home #phoenixSmartMailV2 .px2-reply header{
    margin-bottom:6px!important;
  }
  #home #phoenixSmartMailV2 .px2-reply textarea{
    min-height:62px!important;
    max-height:110px!important;
  }
  #home #phoenixSmartMailV2 .px2-actions button{
    min-height:34px!important;
  }
}

@media (max-width:760px){
  #home #phoenixSmartMailV2 .px2-workspace,
  #home #phoenixSmartMailV2 .px2-list-panel,
  #home #phoenixSmartMailV2 .px2-detail-panel{
    height:auto!important;
    max-height:none!important;
  }
}
