* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-size: arial;
}
body {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background: #0e1327;
}
.chat-container {
    max-width: 100%;
        width: 400px;
    margin: 20px auto;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    
    padding-top: 0;
    overflow: hidden;
}
.chat-container h2 {
    color: #fff;
    background: cornflowerblue;
    height: 3em;
    position: absolute;
    top: 0%;
    left: 0;
    width: 100%;
    margin: 0;
    padding: 0 1em;
    display: flex;
    align-items: center;
  justify-content: space-between;
  flex-direction: row-reverse;
  font-size: 1.2em;
}
.chat-container a {
  color: #fff;
  text-decoration: none;
}

.session-id {
    font-size: 14px;
    margin-top: 6em;
    margin-bottom: .5em;
    color: #555;
}

.messages {
    height: 300px;
    overflow-y: auto;
    border: 1px solid #ccc;
    padding: 10px;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: .8em;
}
.user-message {
    max-width: 60%;
    width: 60%;
}
p.name {
    font-size: .8em;
}
.user-message .main-message {
    background: #f0f0f0;
    padding: 1em;
    border-radius: .4em;
}
.user-message .name {
  padding-left: .3em;
}
.customercare {
    background: #fff !important;
    align-self: end;
    width: 60%;
    max-width: 60%;
}
.customercare .name {
  text-align: right;
}
.customercare .main-message {
    background: #84baef;
    padding: 1em;
    border-radius: .4em;
    width: 100%;
    color: #fff;
    font-weight: 500;
}

.chat-container input[type="text"] {
    width: 70%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.chat-container button {
    padding: 10px 15px;
    border: none;
    background-color: cornflowerblue;
    color: white;
    border-radius: 4px;
    cursor: pointer;
}

.chat-container button:hover {
    opacity: .9;
}
label {
  cursor: pointer;
}
.toggleLiveChat {
  position: fixed;
  bottom: 2em;
  right: 1em;
  border-radius: 9999px;
  background: cornflowerblue;
  height: 3em;
  width: 10em;
  display: none;
  justify-content: center;
  align-items: center;
  color: #fff;
  font-weight: bold;
  gap: .5em;
}

#toggleLiveChat {
  display: none;
}
#toggleLiveChat:checked ~ .chat-container {
  bottom: 5em;
    right: 3em;
}
@media (max-width: 48em) {
  .chat-container {
    width: 100%;
    left: 0;
    top: 100%;
    bottom: initial;
    border-radius: 0;
    height: 100vh;
    margin: 0;
    z-index: 9999;
  }
  #toggleLiveChat:checked ~ .chat-container {
  top: 0;
    right: 0;
}
.messages {
    height: 60vh;
}
}

label.toggleLiveChat:after {
    position: absolute;
    height: .5em;
    width: .5em;
    content: '';
    background: red;
    top: 0;
    left: 0;
    border-radius: 50%;
}
.preview {
    background: #f0f0f0;
    width: 10em;
    position: fixed;
    bottom: 5.8em;
    right: 1em;
    border-radius: .4em;
    padding: .2em .5em;
    font-size: .9em;
    display: none !important;
}
.last-message {
    width: 90%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}