:root{
  --brand:#075e54;
  --brand2:#128c7e;
  --green:#25d366;
  --bg:#efeae2;
  --line:#dfe5e2;
  --text:#1f2d33;
  --muted:#667781;
}

*{box-sizing:border-box}

.hidden{display:none!important}

.sr-only{
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}

.chat-launcher{
  position:fixed;
  right:20px;
  bottom:20px;
  z-index:99998;
  width:230px;
  height:60px;
  border:0;
  border-radius:16px;
  padding:0 18px;
  color:#fff;
  background:linear-gradient(135deg,var(--brand2),var(--brand));
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  box-shadow:0 10px 30px rgba(0,0,0,.24);
  animation:unichatGlow 1.8s ease-in-out infinite;
}

@keyframes unichatGlow{
  0%,100%{
    box-shadow:
      0 10px 30px rgba(0,0,0,.24),
      0 0 0 0 rgba(255,213,74,0);
  }
  50%{
    box-shadow:
      0 10px 30px rgba(0,0,0,.24),
      0 0 20px 8px rgba(255,213,74,.7);
  }
}

.chat-launcher[aria-expanded="true"]{
  opacity:0;
  visibility:hidden;
  pointer-events:none;
}

.launcher-chat{
  width:100%;
  display:flex;
  align-items:center;
  gap:12px;
}

.launcher-icon{
  font-size:24px;
  line-height:1;
}

.launcher-copy{
  display:flex;
  flex-direction:column;
  text-align:left;
  line-height:1.15;
}

.launcher-copy strong{font-size:15px}
.launcher-copy small{font-size:11px;color:rgba(255,255,255,.82)}

.launcher-close{display:none!important}

.launcher-badge{
  position:absolute;
  top:-4px;
  right:-4px;
  width:14px;
  height:14px;
  border-radius:50%;
  border:3px solid #fff;
  background:#e5484d;
}

.chat-box{
  position:fixed;
  right:20px;
  bottom:20px;
  z-index:99999;
  width:min(400px,calc(100vw - 24px));
  height:min(650px,calc(100vh - 40px));
  display:flex;
  flex-direction:column;
  overflow:hidden;
  border:1px solid rgba(0,0,0,.08);
  border-radius:22px;
  background:#fff;
  box-shadow:0 22px 70px rgba(15,35,45,.25);
}

.chat-header{
  min-height:76px;
  padding:13px 15px;
  display:flex;
  align-items:center;
  gap:11px;
  background:linear-gradient(135deg,#0a6a5f,var(--brand));
  color:#fff;
}

.consultant-avatar{
  width:44px;
  height:44px;
  flex:0 0 44px;
  border-radius:14px;
  display:grid;
  place-items:center;
  font-weight:800;
  font-size:19px;
  background:rgba(255,255,255,.16);
  border:1px solid rgba(255,255,255,.2);
}

.chat-header-copy{
  min-width:0;
  flex:1;
  display:flex;
  flex-direction:column;
  gap:4px;
}

.chat-header-copy strong{font-size:15px}

.presence{
  display:flex;
  align-items:center;
  gap:6px;
  font-size:11px;
  color:rgba(255,255,255,.82);
}

.presence i{
  width:8px;
  height:8px;
  border-radius:50%;
  background:#55e58a;
  box-shadow:0 0 0 3px rgba(85,229,138,.14);
}

.icon-button{
  width:38px;
  height:38px;
  border:0;
  border-radius:10px;
  background:transparent;
  color:#fff;
  font-size:28px;
  line-height:1;
  cursor:pointer;
}

.identify-view{
  flex:1;
  padding:28px 24px;
  overflow:auto;
  display:flex;
  flex-direction:column;
  background:#fff;
}

.identify-intro{margin-bottom:22px}

.eyebrow{
  font-size:11px;
  font-weight:800;
  letter-spacing:.12em;
  text-transform:uppercase;
  color:var(--brand2);
}

.identify-intro h2{
  margin:8px 0;
  font-size:25px;
  color:var(--text);
}

.identify-intro p{
  margin:0;
  color:var(--muted);
  font-size:14px;
  line-height:1.45;
}

.identify-view form{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.identify-view label{
  margin-top:4px;
  font-size:12px;
  font-weight:700;
}

.identify-view input{
  width:100%;
  padding:13px 14px;
  border:1px solid var(--line);
  border-radius:12px;
  outline:none;
}

.identify-view input:focus{
  border-color:var(--brand2);
  box-shadow:0 0 0 3px rgba(18,140,126,.1);
}

.form-error{
  min-height:18px;
  margin:0;
  font-size:12px;
  color:#b42318;
}

.primary-button{
  margin-top:6px;
  padding:14px 16px;
  border:0;
  border-radius:12px;
  background:var(--brand);
  color:#fff;
  font-weight:700;
  display:flex;
  justify-content:space-between;
  cursor:pointer;
}

.privacy-note{
  margin-top:auto;
  padding-top:22px;
  text-align:center;
  color:#829099;
  font-size:11px;
}

.chat-main{
  flex:1;
  min-height:0;
  display:flex;
  flex-direction:column;
  background:var(--bg);
}

.messages{
  flex:1;
  min-height:0;
  overflow-y:auto;
  padding:16px 13px 10px;
  background:
    radial-gradient(rgba(7,94,84,.04) 1px,transparent 1px);
  background-size:18px 18px;
}

.welcome-message{
  width:fit-content;
  max-width:90%;
  margin:0 auto 14px;
  padding:7px 10px;
  border-radius:8px;
  background:#fff5c4;
  color:#5b5744;
  font-size:11px;
  text-align:center;
}

.message{
  width:fit-content;
  max-width:82%;
  margin:5px 0;
  padding:9px 11px 7px;
  border-radius:12px;
  background:#fff;
  box-shadow:0 1px 2px rgba(0,0,0,.12);
  word-break:break-word;
}

.message--out{
  margin-left:auto;
  background:#d9fdd3;
  border-top-right-radius:4px;
}

.message--in{
  margin-right:auto;
  border-top-left-radius:4px;
}

.message__text{
  white-space:pre-wrap;
  font-size:14px;
  line-height:1.4;
}

.message time{
  display:block;
  margin-top:4px;
  text-align:right;
  font-size:10px;
  color:#708079;
}

.message img{
  display:block;
  width:100%;
  max-width:250px;
  max-height:260px;
  object-fit:cover;
  border-radius:8px;
  margin-bottom:5px;
}

.message audio{
  display:block;
  width:245px;
  max-width:100%;
}

.file-link{
  color:var(--brand);
  font-size:13px;
  font-weight:700;
  text-decoration:none;
}

.send-error{
  padding:8px 12px;
  background:#fff0ee;
  color:#b42318;
  font-size:12px;
  text-align:center;
}

.attachment-preview{
  padding:7px 12px;
  display:flex;
  align-items:center;
  gap:8px;
  background:#f8faf9;
  border-top:1px solid var(--line);
  font-size:12px;
}

.attachment-preview span{
  flex:1;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.attachment-preview button{
  width:24px;
  height:24px;
  border:0;
  border-radius:50%;
  background:#e6ecea;
  cursor:pointer;
}

.composer{
  padding:8px 8px 7px;
  display:flex;
  align-items:flex-end;
  gap:6px;
  background:#f8faf9;
  border-top:1px solid rgba(0,0,0,.06);
}

.composer textarea{
  flex:1;
  min-width:0;
  min-height:42px;
  max-height:104px;
  resize:none;
  padding:11px 13px;
  border:1px solid var(--line);
  border-radius:20px;
  background:#fff;
  outline:none;
  line-height:18px;
}

.composer-action,
.send-button{
  position:relative;
  flex:0 0 44px;
  width:44px;
  height:44px;
  border:0;
  border-radius:50%;
  display:grid;
  place-items:center;
  cursor:pointer;
}

label.composer-action{
  flex-basis:36px;
  width:36px;
  background:transparent;
  color:#667781;
}

label.composer-action > span[aria-hidden="true"]{
  display:none!important;
}

label.composer-action::before{
  content:"";
  width:22px;
  height:22px;
  background:currentColor;
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M16.5 6.5 8.91 14.09a2 2 0 1 0 2.83 2.83l7.07-7.07a4 4 0 0 0-5.66-5.66L5.38 11.96a6 6 0 0 0 8.49 8.49l6.36-6.36a1 1 0 0 0-1.42-1.42l-6.36 6.36a4 4 0 0 1-5.66-5.66l7.78-7.77a2 2 0 0 1 2.83 2.83l-7.08 7.07a1 1 0 0 0 1.42 1.42l7.07-7.07a4 4 0 0 0-5.66-5.66L7.5 12.67a2 2 0 1 0 2.83 2.83l7.59-7.59a1 1 0 0 0-1.42-1.41Z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M16.5 6.5 8.91 14.09a2 2 0 1 0 2.83 2.83l7.07-7.07a4 4 0 0 0-5.66-5.66L5.38 11.96a6 6 0 0 0 8.49 8.49l6.36-6.36a1 1 0 0 0-1.42-1.42l-6.36 6.36a4 4 0 0 1-5.66-5.66l7.78-7.77a2 2 0 0 1 2.83 2.83l-7.08 7.07a1 1 0 0 0 1.42 1.42l7.07-7.07a4 4 0 0 0-5.66-5.66L7.5 12.67a2 2 0 1 0 2.83 2.83l7.59-7.59a1 1 0 0 0-1.42-1.41Z'/%3E%3C/svg%3E") center/contain no-repeat;
}

#record-audio{
  padding:0;
  background:var(--brand2);
  color:#fff;
  font-size:0!important;
  line-height:1;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 3px 10px rgba(18,140,126,.28);
}

#record-audio::before{
  content:"";
  display:block;
  flex:0 0 24px;
  width:24px;
  height:24px;
  margin:0;
  background:currentColor;
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 14a3 3 0 0 0 3-3V5a3 3 0 0 0-6 0v6a3 3 0 0 0 3 3Zm5-3a1 1 0 1 0-2 0 3 3 0 0 1-6 0 1 1 0 1 0-2 0 5 5 0 0 0 4 4.9V18H8a1 1 0 1 0 0 2h8a1 1 0 1 0 0-2h-3v-2.1A5 5 0 0 0 17 11Z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 14a3 3 0 0 0 3-3V5a3 3 0 0 0-6 0v6a3 3 0 0 0 3 3Zm5-3a1 1 0 1 0-2 0 3 3 0 0 1-6 0 1 1 0 1 0-2 0 5 5 0 0 0 4 4.9V18H8a1 1 0 1 0 0 2h8a1 1 0 1 0 0-2h-3v-2.1A5 5 0 0 0 17 11Z'/%3E%3C/svg%3E") center/contain no-repeat;
}

#record-audio.recording{
  background:#e5484d;
  color:#fff;
  box-shadow:0 3px 10px rgba(229,72,77,.32);
}

#record-audio.recording::before{
  width:23px;
  height:23px;
  flex-basis:23px;
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M2.01 21 23 12 2.01 3 2 10l15 2-15 2 .01 7Z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M2.01 21 23 12 2.01 3 2 10l15 2-15 2 .01 7Z'/%3E%3C/svg%3E") center/contain no-repeat;
}

#record-audio:disabled{
  cursor:wait;
  opacity:.82;
}

.send-button{
  background:var(--brand2);
  color:#fff;
  font-size:0!important;
  box-shadow:0 3px 10px rgba(18,140,126,.28);
}

.send-button::before{
  content:"";
  width:23px;
  height:23px;
  background:currentColor;
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M2.01 21 23 12 2.01 3 2 10l15 2-15 2 .01 7Z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M2.01 21 23 12 2.01 3 2 10l15 2-15 2 .01 7Z'/%3E%3C/svg%3E") center/contain no-repeat;
}

.composer-foot{
  padding:0 12px 7px;
  background:#f8faf9;
  color:#8a9692;
  font-size:10px;
  text-align:center;
}

@media(max-width:560px){
  .chat-launcher{
    left:12px;
    right:12px;
    bottom:max(12px,env(safe-area-inset-bottom));
    width:auto;
    height:58px;
  }

  .launcher-chat{
    justify-content:center;
  }

  .chat-box{
    inset:0;
    width:100vw;
    height:100dvh;
    border:0;
    border-radius:0;
  }

  .chat-header{
    padding-top:max(14px,env(safe-area-inset-top));
  }

  .identify-view{
    padding:26px 20px max(24px,env(safe-area-inset-bottom));
  }

  .composer{
    gap:4px;
    padding-left:5px;
    padding-right:5px;
  }

  label.composer-action{
    flex-basis:34px;
    width:34px;
  }

  #record-audio,
  .send-button{
    flex-basis:44px;
    width:44px;
    height:44px;
  }

  .composer-foot{
    padding-bottom:max(7px,env(safe-area-inset-bottom));
  }
}
