/* User support chat modal */
body.dc-support-open{
  overflow:hidden!important;
}

.dc-support{
  position:fixed;
  inset:0;
  z-index:100010;
  display:flex;
  align-items:flex-end;
  justify-content:center;
  pointer-events:none;
}

.dc-support[hidden]{
  display:none!important;
}

.dc-support:not([hidden]){
  pointer-events:auto;
}

.dc-support__backdrop{
  position:absolute;
  inset:0;
  border:0;
  background:rgba(0,0,0,.62);
  backdrop-filter:blur(4px);
  -webkit-backdrop-filter:blur(4px);
}

.dc-support__panel{
  position:relative;
  z-index:1;
  width:100%;
  max-width:430px;
  height:min(88vh,720px);
  max-height:calc(100vh - 24px);
  margin:0 auto 0;
  display:flex;
  flex-direction:column;
  border-radius:20px 20px 0 0;
  border:1px solid rgba(255,255,255,.10);
  border-bottom:0;
  background:linear-gradient(180deg,#1a222b 0%,#12171d 100%);
  box-shadow:0 -18px 48px rgba(0,0,0,.45);
  overflow:hidden;
}

.dc-support__head-shell{
  flex:none;
  padding:10px 12px 8px;
  padding-top:calc(10px + env(safe-area-inset-top,0px));
}

.dc-support .cp-topbar{
  display:grid;
  grid-template-columns:44px minmax(0,1fr) 44px;
  align-items:center;
  gap:10px;
  min-height:52px;
  margin:0;
  padding:6px 10px 6px 6px;
  border-radius:999px;
  border:1px solid rgba(255,138,0,.16);
  background:
    radial-gradient(circle at 8% 50%,rgba(255,138,0,.07),transparent 42%),
    linear-gradient(180deg,rgba(22,22,22,.98),rgba(10,10,10,.96));
  box-shadow:
    0 10px 28px rgba(0,0,0,.28),
    inset 0 1px 0 rgba(255,255,255,.05);
  backdrop-filter:blur(14px);
  -webkit-backdrop-filter:blur(14px);
}

.dc-support .cp-topbar__back{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:36px;
  height:36px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.04);
  color:rgba(255,211,145,.92);
  text-decoration:none;
  transition:background .15s ease,border-color .15s ease,color .15s ease;
  -webkit-tap-highlight-color:transparent;
  appearance:none;
  -webkit-appearance:none;
  padding:0;
  cursor:pointer;
}

.dc-support .cp-topbar__back:active{
  background:rgba(255,138,0,.10);
  border-color:rgba(255,138,0,.28);
  color:#ffd391;
}

.dc-support .cp-topbar__back svg{
  width:20px;
  height:20px;
  display:block;
}

.dc-support .cp-topbar__title{
  margin:0!important;
  padding:0!important;
  font-size:16px!important;
  line-height:1.2!important;
  font-weight:400!important;
  letter-spacing:.01em;
  color:#fff!important;
  text-align:center;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.dc-support .cp-topbar__spacer{
  display:block;
  width:36px;
  height:36px;
  justify-self:end;
}

.dc-support__messages{
  flex:1 1 auto;
  min-height:0;
  overflow:auto;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
  padding:14px 12px;
  display:flex;
  flex-direction:column;
  gap:8px;
}

.dc-support__error{
  align-self:center;
  max-width:92%;
  padding:8px 12px;
  border-radius:12px;
  border:1px solid rgba(255,96,96,.28);
  background:rgba(255,96,96,.12);
  color:#ffb4b4;
  font-size:13px;
  line-height:1.35;
  text-align:center;
}

.dc-support__msg{
  display:flex;
  width:100%;
}

.dc-support__msg.is-mine{
  justify-content:flex-end;
}

.dc-support__msg.is-theirs{
  justify-content:flex-start;
}

.dc-support__bubble{
  max-width:82%;
  padding:9px 12px 7px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.08);
  background:rgba(255,255,255,.06);
}

.dc-support__msg.is-mine .dc-support__bubble{
  border-color:rgba(255,138,0,.28);
  background:linear-gradient(180deg,rgba(255,138,0,.22),rgba(255,138,0,.10));
}

.dc-support__text{
  font-size:14px;
  line-height:1.45;
  color:#f3f5f8;
  white-space:pre-wrap;
  word-break:break-word;
}

.dc-support__time{
  display:block;
  margin-top:4px;
  font-size:10px;
  line-height:1;
  color:rgba(255,255,255,.42);
  text-align:right;
}

.dc-support__msg.is-theirs .dc-support__time{
  text-align:left;
}

.dc-support__composer{
  display:flex;
  align-items:flex-end;
  gap:8px;
  flex:none;
  padding:10px 12px calc(10px + env(safe-area-inset-bottom,0px));
  border-top:1px solid rgba(255,255,255,.08);
  background:rgba(0,0,0,.22);
}

body.dc-support-keyboard .dc-support__composer{
  padding-bottom:10px;
}

.dc-support__composer textarea{
  flex:1 1 auto;
  min-height:42px;
  max-height:120px;
  resize:none;
  margin:0;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.06);
  color:#fff;
  font:inherit;
  font-size:14px;
  line-height:1.35;
}

.dc-support__composer textarea:focus{
  outline:none;
  border-color:rgba(255,138,0,.42);
}

.dc-support__send{
  appearance:none;
  -webkit-appearance:none;
  flex:0 0 42px;
  width:42px;
  height:42px;
  border:0;
  border-radius:999px;
  background:linear-gradient(135deg,#ff9a2f,#ff611d);
  color:#111;
  font-size:18px;
  font-weight:900;
  cursor:pointer;
}

@media (max-width:767px){
  body.dc-support-open{
    position:fixed;
    width:100%;
    height:100%;
  }

  body.dc-support-open .user-bottom-nav{
    visibility:hidden!important;
    pointer-events:none!important;
  }

  .dc-support{
    align-items:stretch;
    justify-content:stretch;
  }

  .dc-support__panel{
    position:fixed;
    top:var(--dc-support-vv-top,0px);
    left:0;
    right:0;
    width:100%;
    max-width:none;
    height:var(--dc-support-vv-height,100dvh);
    max-height:none;
    margin:0;
    border-radius:0;
    border:0;
    border-top:0;
    box-shadow:none;
  }

  .dc-support__composer{
    position:relative;
    z-index:2;
    touch-action:manipulation;
  }

  .dc-support__send{
    touch-action:manipulation;
  }

  .dc-support__composer textarea{
    font-size:16px;
    touch-action:manipulation;
  }
}

@media (min-width:768px){
  .dc-support{
    align-items:center;
    padding:24px;
  }
  .dc-support__panel{
    border-radius:20px;
    border-bottom:1px solid rgba(255,255,255,.10);
    height:min(78vh,680px);
    max-height:none;
  }
}
