/* NJW-246 mobile certification override for /property/home.
   Loaded only at phone/tablet widths; desktop Property Home is unchanged. */

@media (max-width: 820px){
  /* The off-canvas app menu is a critical mobile navigation surface. */
  body.hm-dashboard-page .hm27-nav-panel{
    left:8px;
    top:calc(8px + env(safe-area-inset-top));
    bottom:calc(8px + env(safe-area-inset-bottom));
    width:calc(100vw - 16px);
    max-height:calc(100dvh - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }

  body.hm-dashboard-page .hm27-nav-close{
    width:44px;
    height:44px;
    min-width:44px;
    min-height:44px;
    touch-action:manipulation;
  }

  body.hm-dashboard-page .hm27-nav-head .hm27-brand-copy small{
    font-size:11px!important;
    line-height:1.2!important;
  }

  body.hm-dashboard-page .hm27-nav-links a,
  body.hm-dashboard-page .hm27-nav-foot button{
    min-height:48px!important;
    touch-action:manipulation;
  }

  body.hm-dashboard-page .hm27-nav-links a{
    padding:12px 14px!important;
    font-size:15px!important;
    line-height:1.3!important;
  }

  body.hm-dashboard-page .hm27-nav-links a i{
    width:22px!important;
    font-size:15px!important;
  }

  body.hm-dashboard-page .hm27-nav-foot button{
    height:auto!important;
    font-size:14px!important;
    line-height:1.3!important;
  }

  /* The desktop selector command strip becomes a mobile command stack instead of being compressed. */
  body.hm-dashboard-page .hm-top-in{
    padding:16px 16px 12px!important;
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    grid-template-areas:
      "back saved"
      "label label"
      "switch switch"
      "actions actions"!important;
    gap:10px!important;
    align-items:center!important;
  }

  body.hm-dashboard-page .hm-back{
    grid-area:back;
    min-height:44px!important;
    width:max-content;
    max-width:100%;
    font-size:14px!important;
    line-height:1.3!important;
    touch-action:manipulation;
  }

  body.hm-dashboard-page .hm-switch-label{
    grid-area:label;
    margin-top:2px!important;
    font-size:12px!important;
    line-height:1.25!important;
  }

  body.hm-dashboard-page #hm-switch{
    grid-area:switch;
    width:100%!important;
    max-width:none!important;
    height:48px!important;
    min-height:48px!important;
    font-size:16px!important;
    line-height:1.3!important;
  }

  body.hm-dashboard-page .hm-saved{
    grid-area:saved;
    justify-self:end!important;
    max-width:46vw;
    font-size:13px!important;
    line-height:1.3!important;
    text-align:right;
    white-space:normal!important;
  }

  body.hm-dashboard-page .hm27-page-actions{
    grid-area:actions;
    width:100%;
    display:grid!important;
    grid-template-columns:minmax(0,1.3fr) repeat(2,minmax(0,1fr));
    gap:8px!important;
    justify-self:stretch!important;
  }

  body.hm-dashboard-page .hm27-action{
    min-width:0;
    min-height:44px!important;
    height:auto!important;
    padding:10px 12px!important;
    justify-content:center;
    font-size:14px!important;
    line-height:1.25!important;
    white-space:normal!important;
    text-align:center;
    touch-action:manipulation;
  }

  /* Profile and notification popovers must behave like mobile sheets, not desktop menus. */
  body.hm-dashboard-page .hm27-pop{
    left:8px!important;
    right:8px!important;
    top:calc(68px + env(safe-area-inset-top))!important;
    width:auto!important;
    max-width:none!important;
    max-height:calc(100dvh - 84px - env(safe-area-inset-top) - env(safe-area-inset-bottom))!important;
    overflow:hidden!important;
    padding-bottom:max(10px,env(safe-area-inset-bottom))!important;
  }

  body.hm-dashboard-page .hm27-pop header small{
    font-size:12px!important;
    line-height:1.35!important;
  }

  body.hm-dashboard-page #hm27-profile-pop nav a,
  body.hm-dashboard-page #hm27-profile-pop nav .hm27-menu-row{
    min-height:56px!important;
    touch-action:manipulation;
  }

  body.hm-dashboard-page #hm27-profile-pop nav span b{
    font-size:14px!important;
  }

  body.hm-dashboard-page #hm27-profile-pop nav span small{
    font-size:12px!important;
    line-height:1.4!important;
  }

  body.hm-dashboard-page .hm27-pop-signout,
  body.hm-dashboard-page .hm27-read,
  body.hm-dashboard-page .hm27-notice-foot{
    min-height:44px!important;
    font-size:13px!important;
    touch-action:manipulation;
  }

  body.hm-dashboard-page .hm27-read{
    min-width:64px;
    padding:0 10px!important;
  }

  body.hm-dashboard-page #hm27-notice-pop{
    display:flex!important;
    flex-direction:column!important;
  }

  body.hm-dashboard-page .hm27-notice-list{
    flex:1 1 auto;
    min-height:0;
    max-height:none!important;
    overflow-y:auto!important;
    overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch;
  }

  body.hm-dashboard-page .hm27-notice{
    min-height:64px!important;
    padding:11px 10px!important;
    touch-action:manipulation;
  }

  body.hm-dashboard-page .hm27-notice span b{
    font-size:13px!important;
    line-height:1.35!important;
  }

  body.hm-dashboard-page .hm27-notice span small{
    font-size:12px!important;
    line-height:1.35!important;
  }

  body.hm-dashboard-page .hm27-notice span em{
    font-size:11px!important;
    line-height:1.35!important;
  }

  body.hm-dashboard-page .hm27-notice-empty b{
    font-size:14px!important;
  }

  body.hm-dashboard-page .hm27-notice-empty small{
    font-size:12px!important;
    line-height:1.4!important;
  }

  body.hm-dashboard-page .hm27-notice-foot{
    padding:8px 10px max(4px,env(safe-area-inset-bottom))!important;
  }

  /* Agent Intel is valuable on mobile, but its compact desktop density is not. Preserve the content and promote it to a readable sheet. */
  body.hm-dashboard-page .hm-mobile-intel .mobile-intel-sheet{
    max-height:calc(100dvh - max(18px,env(safe-area-inset-top)))!important;
    padding-left:18px!important;
    padding-right:18px!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    overflow-wrap:anywhere;
  }

  body.hm-dashboard-page .hm-mobile-intel .mobile-intel-close{
    min-width:44px!important;
    min-height:44px!important;
    touch-action:manipulation;
  }

  body.hm-dashboard-page .hm-mobile-intel .wdai-title>span,
  body.hm-dashboard-page .hm-mobile-intel .wd-density-copy>span{
    font-size:12px!important;
    line-height:1.3!important;
  }

  body.hm-dashboard-page .hm-mobile-intel .wdai-title h2{
    font-size:20px!important;
    line-height:1.2!important;
  }

  body.hm-dashboard-page .hm-mobile-intel .wdai-title p,
  body.hm-dashboard-page .hm-mobile-intel .wdai-role-prompt p,
  body.hm-dashboard-page .hm-mobile-intel .wdai-card p,
  body.hm-dashboard-page .hm-mobile-intel .wd-density-action{
    font-size:14px!important;
    line-height:1.5!important;
    -webkit-line-clamp:unset!important;
    overflow:visible!important;
  }

  body.hm-dashboard-page .hm-mobile-intel .wdai-persona small{
    font-size:11px!important;
    line-height:1.3!important;
  }

  body.hm-dashboard-page .hm-mobile-intel .wdai-persona b,
  body.hm-dashboard-page .hm-mobile-intel .wdai-role-set,
  body.hm-dashboard-page .hm-mobile-intel .wd-density-trust{
    font-size:12px!important;
    line-height:1.4!important;
  }

  body.hm-dashboard-page .hm-mobile-intel .wd-density-reasons li{
    max-width:none!important;
    font-size:13px!important;
    line-height:1.45!important;
    overflow-wrap:anywhere;
  }

  body.hm-dashboard-page .hm-mobile-intel .wd-density-toggle,
  body.hm-dashboard-page .hm-mobile-intel button,
  body.hm-dashboard-page .hm-mobile-intel select{
    min-height:44px;
    font-size:14px!important;
    line-height:1.25!important;
    touch-action:manipulation;
  }

  body.hm-dashboard-page .hm-mobile-intel select{
    max-width:100%;
    font-size:16px!important;
  }

  /* Long Property Home drill-downs stay complete, but mobile typography and wrapping take priority over desktop density. */
  body.hm-dashboard-page .hm-kind{
    font-size:12px!important;
    line-height:1.3!important;
  }

  body.hm-dashboard-page .sc-l,
  body.hm-dashboard-page .sec2-pro b{
    font-size:12px!important;
    line-height:1.35!important;
  }

  body.hm-dashboard-page .sc-v,
  body.hm-dashboard-page .sec2-pro span{
    font-size:14px!important;
    line-height:1.5!important;
  }

  body.hm-dashboard-page .hm-secbar h2{
    font-size:13px!important;
    line-height:1.35!important;
  }

  body.hm-dashboard-page .sec2-h{
    min-height:56px!important;
    touch-action:manipulation;
  }

  body.hm-dashboard-page .sec2-t{
    min-width:0;
    font-size:16px!important;
    line-height:1.3!important;
    overflow-wrap:anywhere;
  }

  body.hm-dashboard-page .sec2-b,
  body.hm-dashboard-page .sec2-b *{
    max-width:100%;
  }

  body.hm-dashboard-page .sec2-b p,
  body.hm-dashboard-page .sec2-b li,
  body.hm-dashboard-page .sec2-b dd,
  body.hm-dashboard-page .sec2-b td,
  body.hm-dashboard-page .sec2-b th,
  body.hm-dashboard-page .sec2-b a{
    overflow-wrap:anywhere;
    word-break:normal;
  }

  body.hm-dashboard-page .sec2-b table{
    display:block;
    width:100%;
    max-width:100%;
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
  }

  /* Marker drill-down rows are operational mobile navigation, not decorative microcopy. */
  body.hm-dashboard-page .sec2-kicker{
    font-size:12px!important;
    line-height:1.3!important;
    letter-spacing:.08em!important;
  }

  body.hm-dashboard-page .sec2-copy .sec2-s{
    font-size:13px!important;
    line-height:1.45!important;
  }

  body.hm-dashboard-page .sc-data{
    min-height:44px!important;
    font-size:12px!important;
    line-height:1.35!important;
    touch-action:manipulation;
  }

  body.hm-dashboard-page .hs-signal{
    min-height:64px!important;
  }

  body.hm-dashboard-page .hs-open{
    min-height:44px!important;
    touch-action:manipulation;
  }

  body.hm-dashboard-page .hs-icon{
    width:44px!important;
    height:44px!important;
  }

  body.hm-dashboard-page .hs-copy b{
    font-size:14px!important;
    line-height:1.35!important;
  }

  body.hm-dashboard-page .hs-copy small{
    font-size:12px!important;
    line-height:1.4!important;
  }

  body.hm-dashboard-page .hs-chevron{
    font-size:12px!important;
  }

  body.hm-dashboard-page .hs-tool{
    min-height:44px!important;
    margin-left:56px!important;
    padding:10px 12px!important;
    font-size:13px!important;
    line-height:1.25!important;
    touch-action:manipulation;
  }

  /* Final hero and risk-summary pass: preserve evidence, promote labels that were desktop-dense on phones. */
  body.hm-dashboard-page .hm-id p{
    font-size:15px!important;
    line-height:1.45!important;
    overflow-wrap:anywhere;
  }

  body.hm-dashboard-page .hm-val span{
    font-size:13px!important;
    line-height:1.4!important;
  }

  body.hm-dashboard-page .hm-figs{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px 18px!important;
  }

  body.hm-dashboard-page .hm-figs > div{
    min-width:0;
  }

  body.hm-dashboard-page .hm-figs dt{
    font-size:12px!important;
    line-height:1.35!important;
    overflow-wrap:anywhere;
  }

  body.hm-dashboard-page .hm-figs dd{
    font-size:20px!important;
    line-height:1.2!important;
    overflow-wrap:anywhere;
  }

  body.hm-dashboard-page .hm-figs dd em{
    font-size:12px!important;
    line-height:1.4!important;
  }

  body.hm-dashboard-page .rv-score span,
  body.hm-dashboard-page .rr-h{
    font-size:12px!important;
    line-height:1.35!important;
  }

  body.hm-dashboard-page .rv-m-h{
    font-size:13px!important;
    line-height:1.4!important;
    flex-wrap:wrap;
  }

  body.hm-dashboard-page .tipbox{
    font-size:14px!important;
    line-height:1.5!important;
    max-width:calc(100vw - 32px)!important;
  }
}

@media (max-width: 480px){
  body.hm-dashboard-page .hm-top-in{
    grid-template-columns:1fr!important;
    grid-template-areas:
      "back"
      "saved"
      "label"
      "switch"
      "actions"!important;
  }

  body.hm-dashboard-page .hm-saved{
    justify-self:start!important;
    max-width:none;
    text-align:left;
  }

  body.hm-dashboard-page .hm27-page-actions{
    grid-template-columns:1fr 1fr!important;
  }

  body.hm-dashboard-page .hm27-action.primary{
    grid-column:1 / -1;
  }

  body.hm-dashboard-page .hm-mobile-intel .wdai-head,
  body.hm-dashboard-page .hm-mobile-intel .wdai-compact .wdai-head{
    grid-template-columns:1fr!important;
  }

  body.hm-dashboard-page .hm-mobile-intel .wdai-persona{
    width:100%;
    max-width:100%;
  }

  body.hm-dashboard-page .hm-figs{
    grid-template-columns:1fr!important;
  }

  body.hm-dashboard-page .hs-tool{
    margin-left:0!important;
    width:100%;
  }
}
