.chat-heading-main{
  display:flex;
  align-items:center;
  min-width:0;
  gap:7px;
}

.chat-window-add{
  width:24px;
  height:24px;
  flex:0 0 24px;
  display:grid;
  place-items:center;
  padding:0;
  border:1px solid rgba(204,146,70,.28);
  border-radius:4px;
  background:rgba(11,10,9,.58);
  color:var(--gold-b);
  font-family:var(--font-ui);
  font-size:18px;
  font-weight:500;
  line-height:1;
  cursor:pointer;
  transition:border-color var(--tr),background var(--tr),color var(--tr),box-shadow var(--tr);
}

.chat-window-add:hover,
.chat-window-add.active{
  border-color:rgba(232,181,100,.58);
  background:rgba(204,146,70,.12);
  color:#f1ce86;
  box-shadow:0 0 14px rgba(204,146,70,.12);
}

.floating-chat-panel{
  position:absolute;
  z-index:72;
  left:clamp(230px,18%,340px);
  top:clamp(82px,13%,126px);
  width:420px;
  height:300px;
  min-width:320px;
  min-height:230px;
  max-width:calc(100% - 24px);
  max-height:calc(100% - 24px);
  display:flex;
  flex-direction:column;
  box-sizing:border-box;
  overflow:hidden;
  border:1px solid rgba(232,181,100,.34);
  border-radius:7px;
  background:
    linear-gradient(180deg,rgba(18,20,22,.52),rgba(6,8,10,.46)),
    radial-gradient(115% 85% at 50% 0,rgba(204,146,70,.09),transparent 68%);
  box-shadow:
    0 18px 42px rgba(0,0,0,.44),
    inset 0 1px 0 rgba(255,236,194,.07),
    inset 0 0 32px rgba(0,0,0,.12);
  backdrop-filter:blur(17px) saturate(.9) brightness(.82);
  -webkit-backdrop-filter:blur(17px) saturate(.9) brightness(.82);
  color:var(--text-1);
}

.floating-chat-panel[hidden]{
  display:none!important;
}

.floating-chat-header{
  min-height:38px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:5px 7px 5px 12px;
  border-bottom:1px solid rgba(204,146,70,.2);
  background:linear-gradient(180deg,rgba(232,181,100,.045),rgba(0,0,0,.055));
  cursor:move;
  user-select:none;
  touch-action:none;
}

.floating-chat-title{
  overflow:hidden;
  color:var(--gold-b);
  font-size:10px;
  font-weight:800;
  letter-spacing:.1em;
  text-overflow:ellipsis;
  text-transform:uppercase;
  white-space:nowrap;
}

.floating-chat-actions{
  display:flex;
  align-items:center;
  gap:2px;
}

.floating-chat-actions .chg,
.floating-chat-close{
  width:27px;
  height:27px;
  flex:0 0 27px;
}

.floating-chat-close{
  display:grid;
  place-items:center;
  padding:0;
  border:0;
  border-radius:4px;
  background:transparent;
  color:var(--text-3);
  font-family:var(--font-ui);
  font-size:18px;
  line-height:1;
  cursor:pointer;
  transition:background var(--tr),color var(--tr);
}

.floating-chat-close:hover{
  background:rgba(224,118,100,.1);
  color:#ee9a8d;
}

.floating-chat-settings{
  top:39px;
  right:7px;
  background:
    linear-gradient(180deg,rgba(20,18,16,.68),rgba(7,8,10,.64)),
    radial-gradient(110% 80% at 50% 0,rgba(204,146,70,.08),transparent 68%);
  backdrop-filter:blur(15px) saturate(.88);
  -webkit-backdrop-filter:blur(15px) saturate(.88);
}

.floating-chat-body{
  flex:1 1 auto;
  min-height:0;
  overflow-y:auto;
  overscroll-behavior:contain;
  padding:8px 13px 10px;
  background:
    linear-gradient(180deg,rgba(255,228,176,.018),transparent 24%),
    rgba(0,0,0,.065);
  font-size:12px;
  line-height:1.55;
  scrollbar-color:rgba(204,146,70,.44) rgba(0,0,0,.2);
  scrollbar-width:thin;
}

.floating-chat-body::-webkit-scrollbar{
  width:6px;
}

.floating-chat-body::-webkit-scrollbar-track{
  background:rgba(0,0,0,.2);
}

.floating-chat-body::-webkit-scrollbar-thumb{
  border-radius:5px;
  background:rgba(204,146,70,.44);
}

.floating-chat-input-row{
  position:relative;
  flex:0 0 auto;
  padding:7px 10px 10px;
  background:rgba(0,0,0,.1);
}

.floating-chat-resize{
  position:absolute;
  right:2px;
  bottom:2px;
  z-index:3;
  width:18px;
  height:18px;
  padding:0;
  border:0;
  background:
    linear-gradient(135deg,transparent 43%,rgba(232,181,100,.32) 44%,rgba(232,181,100,.32) 49%,transparent 50%) 6px 6px/8px 8px no-repeat,
    linear-gradient(135deg,transparent 43%,rgba(232,181,100,.6) 44%,rgba(232,181,100,.6) 49%,transparent 50%) 10px 10px/8px 8px no-repeat;
  cursor:nwse-resize;
  touch-action:none;
  opacity:.72;
}

.floating-chat-resize:hover{
  opacity:1;
}

@media (max-width:1220px),(max-height:760px){
  .floating-chat-panel{
    width:380px;
    height:270px;
    min-width:300px;
    min-height:210px;
    left:clamp(160px,15%,250px);
    top:clamp(64px,11%,96px);
  }
  .floating-chat-body{
    padding:6px 10px 8px;
    font-size:11px;
  }
  .floating-chat-input-row{
    padding:6px 8px 8px;
  }
}

@media (orientation:landscape) and (min-width:960px) and (max-width:1280px){
  .floating-chat-panel{
    width:390px;
    height:275px;
    min-width:300px;
    min-height:210px;
    left:clamp(112px,14%,210px);
    top:68px;
  }
}
