/* CDI V20 - compact related-search / route pill polish
   Purpose: stop fat multi-line chips and keep mobile rails premium. */

body:not(.admin-body) .related-searches-block{
  max-width:1120px!important;
  margin-left:auto!important;
  margin-right:auto!important;
  box-sizing:border-box!important;
}

body:not(.admin-body) .related-searches-block > p{
  margin-bottom:10px!important;
  font-size:12px!important;
  line-height:1.2!important;
  letter-spacing:.075em!important;
  color:#607089!important;
}

body:not(.admin-body) .related-searches-rail{
  display:flex!important;
  flex-wrap:wrap!important;
  align-items:center!important;
  gap:8px!important;
  overflow:visible!important;
  padding:0!important;
  margin:0!important;
  scroll-behavior:smooth;
}

body:not(.admin-body) .related-searches-rail .acchip{
  width:auto!important;
  min-width:0!important;
  max-width:none!important;
  min-height:30px!important;
  max-height:34px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:6px!important;
  box-sizing:border-box!important;
  padding:7px 12px!important;
  border-radius:999px!important;
  font-size:12px!important;
  line-height:1!important;
  font-weight:750!important;
  letter-spacing:-.01em!important;
  color:#0B1B32!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  background:#FFFFFF!important;
  border:1px solid #DCE6F1!important;
  box-shadow:0 2px 7px rgba(8,24,44,.045)!important;
  text-decoration:none!important;
}

body:not(.admin-body) .related-searches-rail .acchip:hover,
body:not(.admin-body) .related-searches-rail .acchip:focus-visible{
  border-color:#7FB7E8!important;
  background:#F4FAFF!important;
  color:#08284A!important;
  outline:none!important;
}

/* Any dark active chips need readable contrast and a slimmer height. */
body:not(.admin-body) .filter-pills .active,
body:not(.admin-body) .qf-pills .active,
body:not(.admin-body) .chip-row .active,
body:not(.admin-body) .ph2-qfilter .active,
body:not(.admin-body) .related-searches-rail .active{
  background:#EAF5FF!important;
  border-color:#8CC8F5!important;
  color:#0A3B63!important;
  box-shadow:inset 0 0 0 1px rgba(44,170,226,.18)!important;
}

@media (max-width:760px){
  body:not(.admin-body) .related-searches-block{
    width:100%!important;
    max-width:100%!important;
    padding-left:0!important;
    padding-right:0!important;
  }

  body:not(.admin-body) .related-searches-rail{
    display:grid!important;
    grid-auto-flow:column!important;
    grid-template-rows:repeat(2,34px)!important;
    grid-auto-columns:max-content!important;
    align-items:center!important;
    gap:8px!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    scroll-snap-type:x proximity!important;
    -webkit-overflow-scrolling:touch!important;
    scrollbar-width:none!important;
    padding:2px 2px 10px!important;
    margin:0!important;
  }

  body:not(.admin-body) .related-searches-rail::-webkit-scrollbar{display:none!important;}

  body:not(.admin-body) .related-searches-rail .acchip{
    flex:0 0 auto!important;
    min-height:32px!important;
    max-height:34px!important;
    padding:7px 11px!important;
    font-size:11.75px!important;
    scroll-snap-align:start!important;
    white-space:nowrap!important;
  }
}

@media (max-width:390px){
  body:not(.admin-body) .related-searches-rail{
    grid-template-rows:repeat(2,32px)!important;
    gap:7px!important;
  }
  body:not(.admin-body) .related-searches-rail .acchip{
    min-height:31px!important;
    max-height:32px!important;
    font-size:11.25px!important;
    padding:7px 10px!important;
  }
}

/* ============================================================
   CDI V20 final mobile UX patch - hero rails, drawer spacing,
   clamp toggle polish, and mobile header offset
   ============================================================ */
body:not(.admin-body) .urg{
  margin-top:68px!important;
}
@media(max-width:760px){
  body:not(.admin-body) .urg{margin-top:72px!important;}
  body:not(.admin-body) .urg{display:none!important;}
}

/* Mobile homepage hero chips: proper auto rail, no cut-off, no page overflow */
@media(max-width:760px){
  body:not(.admin-body) .hero-ticks,
  body:not(.admin-body) .tboxes,
  body:not(.admin-body) .comparison-points{
    display:flex!important;
    flex-wrap:nowrap!important;
    gap:10px!important;
    width:100%!important;
    max-width:100%!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    scroll-snap-type:x proximity!important;
    -webkit-overflow-scrolling:touch!important;
    scrollbar-width:none!important;
    padding:2px 2px 10px!important;
    margin-left:0!important;
    margin-right:0!important;
    grid-template-columns:none!important;
  }
  body:not(.admin-body) .hero-ticks::-webkit-scrollbar,
  body:not(.admin-body) .tboxes::-webkit-scrollbar,
  body:not(.admin-body) .comparison-points::-webkit-scrollbar{display:none!important;}

  body:not(.admin-body) .hero-ticks .htick,
  body:not(.admin-body) .tboxes .tbox,
  body:not(.admin-body) .comparison-points span{
    flex:0 0 auto!important;
    scroll-snap-align:start!important;
    min-width:154px!important;
    max-width:188px!important;
    width:auto!important;
    min-height:56px!important;
    border-radius:18px!important;
    white-space:normal!important;
    overflow:hidden!important;
  }
  body:not(.admin-body) .hero-ticks .htick{
    min-height:40px!important;
    padding:9px 14px!important;
    align-items:center!important;
    font-size:13px!important;
    line-height:1.2!important;
  }
  body:not(.admin-body) .tboxes .tbox{
    background:#fff!important;
    border:1px solid rgba(13,31,56,.10)!important;
    box-shadow:0 14px 30px rgba(13,31,56,.08)!important;
    padding:13px 14px!important;
  }
  body:not(.admin-body) .tboxes .tbox strong{
    font-size:16px!important;
    line-height:1.15!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }
  body:not(.admin-body) .tboxes .tbox span{
    display:block!important;
    margin-top:4px!important;
    font-size:12px!important;
    line-height:1.3!important;
    color:#6B7587!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }

  body:not(.admin-body) .comparison-points{
    --cdi-rail-row-gap:10px;
    display:grid!important;
    grid-auto-flow:column!important;
    grid-auto-columns:minmax(220px, 76vw)!important;
    grid-template-rows:repeat(2, minmax(54px, auto))!important;
    gap:10px!important;
    padding-bottom:12px!important;
  }
  body:not(.admin-body) .comparison-points span{
    width:auto!important;
    max-width:none!important;
    min-width:0!important;
    min-height:54px!important;
    padding:11px 13px!important;
    border-radius:16px!important;
    font-size:13.5px!important;
    line-height:1.22!important;
    box-shadow:0 12px 28px rgba(13,31,56,.07)!important;
  }
  body:not(.admin-body) .comparison-points span:before{
    width:24px!important;
    height:24px!important;
    flex-basis:24px!important;
  }
}

/* Read-more / show-less pill with chevron */
@media(max-width:760px){
  body:not(.admin-body) .cdi-mobile-clamp{
    display:-webkit-box!important;
    -webkit-line-clamp:3!important;
    -webkit-box-orient:vertical!important;
    overflow:hidden!important;
    position:relative!important;
    margin-bottom:8px!important;
  }
  body:not(.admin-body) .cdi-mobile-clamp.is-expanded{
    display:block!important;
    -webkit-line-clamp:unset!important;
    overflow:visible!important;
  }
  body:not(.admin-body) .cdi-read-toggle{
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    gap:6px!important;
    min-height:34px!important;
    border:1px solid rgba(47,128,237,.20)!important;
    background:#F2F8FF!important;
    color:#0B5EC8!important;
    border-radius:999px!important;
    padding:7px 12px!important;
    font:800 12px/1 Poppins,system-ui,sans-serif!important;
    box-shadow:0 8px 18px rgba(47,128,237,.08)!important;
    margin:4px 0 14px!important;
  }
  body:not(.admin-body) .cdi-read-toggle .cdi-toggle-icon{
    font-size:13px!important;
    line-height:1!important;
    transform:translateY(-1px)!important;
  }
}

/* Mobile drawer: menu has room, CTAs are compact and never cover last items */
@media(max-width:760px){
  body:not(.admin-body) .mobile-drawer{
    display:flex!important;
    flex-direction:column!important;
    overflow:hidden!important;
    height:100dvh!important;
  }
  body:not(.admin-body) .mobile-drawer .dtop{
    flex:0 0 auto!important;
  }
  body:not(.admin-body) .mobile-drawer .mmenu{
    flex:1 1 auto!important;
    min-height:0!important;
    overflow-y:auto!important;
    padding:16px 18px 8px!important;
  }
  body:not(.admin-body) .mobile-drawer .dfoot{
    flex:0 0 auto!important;
    position:relative!important;
    display:grid!important;
    grid-template-columns:1fr 1fr!important;
    gap:9px!important;
    padding:10px 18px calc(16px + env(safe-area-inset-bottom))!important;
    border-top:1px solid rgba(12,31,56,.08)!important;
    background:linear-gradient(180deg,rgba(255,255,255,.96),#fff)!important;
    box-shadow:0 -16px 34px rgba(12,31,56,.08)!important;
  }
  body:not(.admin-body) .mobile-drawer .dfoot .btn{
    width:100%!important;
    min-height:42px!important;
    padding:10px 11px!important;
    border-radius:14px!important;
    font-size:12.5px!important;
    white-space:normal!important;
  }
  body:not(.admin-body) .mobile-drawer .dfoot .btn:nth-child(3),
  body:not(.admin-body) .mobile-drawer .dfoot .cdi-install-menu-btn{
    grid-column:1 / -1!important;
  }
  body:not(.admin-body) .mobile-drawer .mmenu-flat{
    min-height:52px!important;
  }
}

/* Keep mobile content below fixed nav when urgency strip is hidden */
@media(max-width:760px){
  body:not(.admin-body) .cdi-premium > .hero:first-child,
  body:not(.admin-body) main > .hero:first-child,
  body:not(.admin-body) .mphero:first-child,
  body:not(.admin-body) .page-hero:first-child,
  body:not(.admin-body) .cdi-hero:first-child{
    padding-top:96px!important;
  }
}
