/* ============================================================
   BOTVIET FACEBOOK FANPAGE PICKER R52
   Scope: ONLY Facebook platform card on /app/connections.
   ============================================================ */

/* The Facebook card becomes the row-height reference; grid siblings stretch
   automatically so all four cards remain visually balanced. */
.connections-r42 .r42-platform-grid>.r44-platform-card.r42-facebook{
  min-height:365px!important;
  overflow:visible!important;
  z-index:6!important;
}

.connections-r42 .r42-platform-grid>.r44-platform-card:not(.r42-facebook){
  min-height:365px!important;
}

/* Do not let the new panel collide with the fixed action row. */
.connections-r42 .r42-platform-grid>.r44-platform-card.r42-facebook .r44-platform-copy{
  padding-bottom:94px!important;
}

.connections-r42 .r52-facebook-pages{
  position:absolute!important;
  z-index:18!important;
  left:20px!important;
  right:20px!important;
  bottom:83px!important;
  min-width:0!important;
  box-sizing:border-box!important;
}

.connections-r42 .r52-pages-label{
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:8px!important;
  margin:0 3px 7px!important;
  color:#8eabd0!important;
  font-size:10px!important;
  line-height:1.2!important;
}

.connections-r42 .r52-pages-label>span{
  font-weight:750!important;
}

.connections-r42 .r52-pages-label>b{
  flex:0 0 auto!important;
  padding:3px 7px!important;
  border-radius:999px!important;
  color:#5ee8c2!important;
  background:rgba(14,184,144,.12)!important;
  border:1px solid rgba(37,215,171,.10)!important;
  font-size:9px!important;
}

.connections-r42 .r52-fanpage-picker{
  position:relative!important;
  z-index:20!important;
  width:100%!important;
}

.connections-r42 .r52-fanpage-trigger{
  width:100%!important;
  min-width:0!important;
  height:52px!important;
  padding:5px 9px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:8px!important;
  border-radius:14px!important;
  border:1px solid rgba(51,145,255,.52)!important;
  background:
    radial-gradient(circle at 15% 0%,rgba(35,127,255,.12),transparent 40%),
    linear-gradient(145deg,rgba(8,45,95,.97),rgba(5,30,70,.98))!important;
  color:#eaf6ff!important;
  box-shadow:
    inset 0 0 14px rgba(65,154,255,.035),
    0 8px 20px rgba(0,0,0,.13)!important;
  cursor:pointer!important;
  transition:border-color .18s ease,box-shadow .18s ease,transform .18s ease!important;
}

.connections-r42 .r52-fanpage-trigger:hover,
.connections-r42 .r52-fanpage-picker.is-open .r52-fanpage-trigger{
  border-color:#35b9ff!important;
  box-shadow:
    inset 0 0 15px rgba(63,167,255,.06),
    0 0 18px rgba(31,142,255,.17)!important;
}

.connections-r42 .r52-fanpage-picker.is-open .r52-fanpage-trigger{
  transform:translateY(-1px)!important;
}

.connections-r42 .r52-fanpage-trigger-main{
  display:grid!important;
  grid-template-columns:34px minmax(0,1fr)!important;
  align-items:center!important;
  gap:9px!important;
  min-width:0!important;
  text-align:left!important;
}

.connections-r42 .r52-facebook-mini{
  width:34px!important;
  height:34px!important;
  display:grid!important;
  place-items:center!important;
  border-radius:11px!important;
  color:#fff!important;
  background:linear-gradient(145deg,#238cff,#1665dc)!important;
  box-shadow:0 0 14px rgba(34,123,255,.20)!important;
  font-style:normal!important;
  font-size:22px!important;
  font-family:Arial,sans-serif!important;
  font-weight:900!important;
}

.connections-r42 .r52-fanpage-trigger-main>em{
  min-width:0!important;
  display:block!important;
  font-style:normal!important;
}

.connections-r42 .r52-fanpage-trigger-main strong,
.connections-r42 .r52-fanpage-trigger-main small{
  display:block!important;
  width:100%!important;
  min-width:0!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
}

.connections-r42 .r52-fanpage-trigger-main strong{
  color:#fff!important;
  font-size:11px!important;
  line-height:1.2!important;
}

.connections-r42 .r52-fanpage-trigger-main small{
  margin-top:3px!important;
  color:#87a8ce!important;
  font-size:8px!important;
}

.connections-r42 .r52-fanpage-chevron{
  flex:0 0 auto!important;
  width:27px!important;
  height:27px!important;
  display:grid!important;
  place-items:center!important;
  border-radius:9px!important;
  color:#72d8ff!important;
  background:rgba(30,111,202,.18)!important;
  font-size:17px!important;
  transition:transform .18s ease!important;
}

.connections-r42 .r52-fanpage-picker.is-open .r52-fanpage-chevron{
  transform:rotate(180deg)!important;
}

/* Menu opens upward so it never collides with the two action buttons. */
.connections-r42 .r52-fanpage-menu{
  position:absolute!important;
  z-index:80!important;
  left:0!important;
  right:0!important;
  bottom:calc(100% + 8px)!important;
  width:100%!important;
  max-height:286px!important;
  padding:8px!important;
  overflow:hidden!important;
  border-radius:16px!important;
  border:1px solid rgba(49,159,255,.70)!important;
  background:
    radial-gradient(circle at 10% 0%,rgba(30,115,255,.13),transparent 42%),
    linear-gradient(155deg,#071f49,#04152f 92%)!important;
  box-shadow:
    0 22px 44px rgba(0,0,0,.42),
    0 0 26px rgba(26,131,255,.15),
    inset 0 0 0 1px rgba(119,202,255,.035)!important;
  backdrop-filter:blur(16px)!important;
}

.connections-r42 .r52-fanpage-menu[hidden]{
  display:none!important;
}

.connections-r42 .r52-fanpage-menu-head{
  min-height:29px!important;
  padding:2px 5px 7px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:8px!important;
  border-bottom:1px solid rgba(59,126,206,.26)!important;
}

.connections-r42 .r52-fanpage-menu-head span{
  color:#e7f4ff!important;
  font-size:10px!important;
  font-weight:850!important;
}

.connections-r42 .r52-fanpage-menu-head b{
  min-width:22px!important;
  height:22px!important;
  display:grid!important;
  place-items:center!important;
  border-radius:8px!important;
  color:#49ceff!important;
  background:rgba(27,105,200,.24)!important;
  font-size:9px!important;
}

.connections-r42 .r52-fanpage-options{
  max-height:205px!important;
  margin-top:6px!important;
  overflow:auto!important;
  overscroll-behavior:contain!important;
  scrollbar-width:thin!important;
  scrollbar-color:#2578cc transparent!important;
}

.connections-r42 .r52-fanpage-option{
  width:100%!important;
  min-width:0!important;
  min-height:51px!important;
  padding:6px!important;
  display:grid!important;
  grid-template-columns:38px minmax(0,1fr) auto!important;
  align-items:center!important;
  gap:8px!important;
  border:0!important;
  border-radius:11px!important;
  color:#eaf5ff!important;
  background:transparent!important;
  text-align:left!important;
  cursor:pointer!important;
  transition:background .16s ease,transform .16s ease!important;
}

.connections-r42 .r52-fanpage-option:hover{
  background:rgba(22,91,181,.25)!important;
  transform:translateX(2px)!important;
}

.connections-r42 .r52-fanpage-option.is-current{
  background:linear-gradient(90deg,rgba(17,110,217,.29),rgba(8,62,137,.15))!important;
  box-shadow:inset 0 0 0 1px rgba(61,175,255,.18)!important;
}

.connections-r42 .r52-page-avatar{
  width:38px!important;
  height:38px!important;
  display:grid!important;
  place-items:center!important;
  overflow:hidden!important;
  border-radius:12px!important;
  background:linear-gradient(145deg,#238cff,#155bc7)!important;
  box-shadow:0 5px 12px rgba(0,0,0,.18)!important;
}

.connections-r42 .r52-page-avatar img{
  width:100%!important;
  height:100%!important;
  object-fit:cover!important;
  display:block!important;
}

.connections-r42 .r52-page-avatar i{
  color:#fff!important;
  font-style:normal!important;
  font-family:Arial,sans-serif!important;
  font-size:23px!important;
  font-weight:900!important;
}

.connections-r42 .r52-page-copy{
  min-width:0!important;
}

.connections-r42 .r52-page-copy b,
.connections-r42 .r52-page-copy small{
  display:block!important;
  min-width:0!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
}

.connections-r42 .r52-page-copy b{
  color:#fff!important;
  font-size:10px!important;
}

.connections-r42 .r52-page-copy small{
  margin-top:3px!important;
  color:#7999bf!important;
  font-size:7.5px!important;
}

.connections-r42 .r52-page-state{
  flex:0 0 auto!important;
  font-size:7.5px!important;
}

.connections-r42 .r52-page-state strong{
  padding:4px 7px!important;
  border-radius:999px!important;
  color:#50e8bd!important;
  background:rgba(11,170,129,.17)!important;
  font-size:7.5px!important;
}

.connections-r42 .r52-page-state em{
  color:#60c9ff!important;
  font-style:normal!important;
  white-space:nowrap!important;
}

.connections-r42 .r52-page-state i{
  color:#7aa2ce!important;
  font-style:normal!important;
}

.connections-r42 .r52-fanpage-menu-foot{
  min-height:32px!important;
  margin-top:5px!important;
  padding:6px 4px 0!important;
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:8px!important;
  border-top:1px solid rgba(59,126,206,.22)!important;
}

.connections-r42 .r52-fanpage-menu-foot span{
  color:#758fad!important;
  font-size:7.5px!important;
}

.connections-r42 .r52-fanpage-menu-foot button{
  border:0!important;
  padding:0!important;
  color:#46caff!important;
  background:transparent!important;
  font-size:7.5px!important;
  font-weight:800!important;
  cursor:pointer!important;
}

.connections-r42 .r52-pages-reload{
  width:100%!important;
  height:44px!important;
  border-radius:13px!important;
  border:1px dashed rgba(64,155,255,.48)!important;
  color:#4fd1ff!important;
  background:rgba(10,58,123,.20)!important;
  font-size:9px!important;
  font-weight:800!important;
  cursor:pointer!important;
}

/* Tablet cards remain equal-height. */
@media(max-width:1280px){
  .connections-r42 .r42-platform-grid>.r44-platform-card{
    min-height:355px!important;
  }
}

/* Mobile: compact selector and full-width safe dropdown. */
@media(max-width:640px){
  .connections-r42 .r42-platform-grid>.r44-platform-card.r42-facebook,
  .connections-r42 .r42-platform-grid>.r44-platform-card:not(.r42-facebook){
    min-height:350px!important;
  }

  .connections-r42 .r52-facebook-pages{
    left:16px!important;
    right:16px!important;
    bottom:75px!important;
  }

  .connections-r42 .r52-fanpage-trigger{
    height:50px!important;
  }

  .connections-r42 .r52-fanpage-menu{
    position:fixed!important;
    z-index:10020!important;
    left:12px!important;
    right:12px!important;
    top:auto!important;
    bottom:84px!important;
    width:auto!important;
    max-height:min(62vh,390px)!important;
    border-radius:18px!important;
  }

  .connections-r42 .r52-fanpage-options{
    max-height:min(48vh,300px)!important;
  }

  .connections-r42 .r52-fanpage-option{
    min-height:57px!important;
    grid-template-columns:42px minmax(0,1fr) auto!important;
  }

  .connections-r42 .r52-page-avatar{
    width:42px!important;
    height:42px!important;
  }

  .connections-r42 .r52-page-copy b{
    font-size:11px!important;
  }

  .connections-r42 .r52-page-copy small{
    font-size:8px!important;
  }
}