html,
body {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  color: #333333;
  background: #F0E6C2;
  font-family: sans-serif;
}
*,
*::before,
*::after {
  box-sizing: inherit;
}
h1 {
  text-align: center;
}
.page_wrapper {
  display: grid;
  grid-template-columns: auto minmax(200px, 800px) auto;
  grid-template-rows: auto auto 1fr auto;
  height: 100vh;
  padding: 1em;
}
.header {
  padding: 0 0 1em;
  grid-column: 2 / 3;
  grid-row: 1 / 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 50;
}
.not_connected .header {
  grid-row: 1 / 4;
  flex-wrap: wrap;
  justify-content: center;
  align-items: normal;
  background: #F0E6C2;
}
.not_connected .wbchat_id_input_wrapper {
  width: 100%;
}
@media only screen and (max-width: 767px) {
  .page_wrapper {
    padding: 0;
  }
}
.toast_section {
  grid-column: 2 / 3;
  grid-row: 2 / 3;
  z-index: 80;
}
.messages_section {
  grid-column: 2 / 3;
  grid-row: 3 / 4;
  overflow-y: auto;
  padding-top: 1em;
  border-top: 1px solid #bbbbbb;
  border-bottom: 1px solid #bbbbbb;
  z-index: 20;
}
.message_input_section {
  padding: 0.5em 0;
  grid-column: 2 / 3;
  grid-row: 4 / 5;
  z-index: 50;
}
/**
Header
 */
.header_chat {
  display: flex;
  flex-wrap: wrap;
  padding: 0.5em 1em;
  justify-content: center;
  align-items: center;
  text-align: center;
}
.chat_id {
  line-height: 1.75;
}
@media only screen and (max-width: 767px) {
  .header {
    padding: 0;
  }
  .wbchat_id_display_wrapper {
    display: block;
    text-align: center;
  }
}
.wbchat_id_display {
  font-weight: 700;
}
.wbchat_id_input_wrapper {
  text-align: center;
}
/**
Messages list
 */
.messages_list {
  list-style: none;
  margin: 0;
  padding: 0 1em;
}
.messages_list li {
  margin-bottom: 1em;
  padding: 0.5em;
  border-radius: 0.25em;
  color: #ffffff;
  background: #4B3145;
  display: grid;
  align-items: baseline;
  width: fit-content;
  min-width: 35%;
  max-width: 80%;
  grid-template-columns: minmax(min-content, auto) minmax(min-content, auto) 1fr;
  grid-template-rows: auto auto;
}
.messages_list .list_user {
  grid-column: 1 / 2;
  grid-row: 1 / 2;
  font-weight: 700;
  padding: 0.25rem 0;
}
.messages_list .list_timestamp {
  grid-column: 2 / 3;
  grid-row: 1 / 2;
  font-size: 0.65em;
  padding: 0 0.25rem;
}
.messages_list .list_message {
  grid-column: 1 / 4;
  grid-row: 2 / 3;
  padding: 0.25rem 0;
}
.messages_list li.list_user_self {
  margin-left: auto;
  grid-template-columns: 1fr minmax(min-content, auto) minmax(min-content, auto);
  background: #FF5259;
  color: #FFFFFF;
}
.messages_list li.list_user_self .list_user {
  grid-column: 3 / 4;
  grid-row: 1 / 2;
  padding: 0.25rem 0;
}
.messages_list li.list_user_self .list_timestamp {
  grid-column: 2 / 3;
  grid-row: 1 / 2;
}
.messages_list li.list_user_command_response,
.messages_list li.list_user_command_response_json {
  background: #6E97CC;
}
.messages_list li.list_user_command_error {
  background: #4B3145;
}
.messages_list li.list_user_joined_left_chat {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 100%;
  background: none;
  color: #333333;
  border: 1px solid #FF5259;
}
.messages_list a.list_chat_url,
.messages_list a.list_chat_url:visited {
  color: #FFFFFF;
}
/**
Admin command: Chat list
 */
.chat_list_item {
  display: grid;
  grid-template-columns: 6em 6em 1fr;
  margin-top: 0.75em;
}
.chat_list_item_header {
  font-weight: 700;
  border-bottom: 1px solid #FFFFFF;
  margin-bottom: 1em;
}
.chat_list_mode {
  grid-column: 1 / 2;
  text-align: center;
}
.chat_list_online {
  grid-column: 2 / 3;
  text-align: center;
}
.chat_list_id {
  grid-column: 3 / 4;
  padding-left: 0.5em;
}
.chat_list_details {
  display: grid;
  grid-template-columns: 8em 1fr;
  margin-top: 0.5em;
}
.chat_list_details_title {
  grid-column: 1 / 2;
  text-align: right;
  padding-right: 0.25em;
  margin-top: 0.5em;
}
.chat_list_details_data {
  grid-column: 2 / 3;
  padding-left: 0.25em;
  margin-top: 0.5em;
}
/**
Message entry
 */
.message_form {
  width: 100%;
}
.message_input {
  width: 100%;
  height: 5em;
}
.message_help {
  font-size: 0.75em;
}
@media only screen and (max-width: 767px) {
  .message_form {
    padding: 0 0.5em;
  }
  .message_form label {
    display: none;
  }
  .message_input_section {
    padding: 0;
  }
  .message_input {
    height: auto;
  }
}
.emoticons {
  padding: 0.5em 0;
  line-height: 1.75;
}
.not_connected .emoticons {
  display: none;
}
.emoticon {
  display: inline-block;
  cursor: pointer;
  margin: 0 0.25em;
}
/**
Admin form
 */
.new_chat_form .wbchat_id_input_wrapper {
  text-align: center;
}
.new_chat_form .wbchat_id_input_wrapper form {
  display: inline-block;
  width: 20em;
  max-width: 80%;
  text-align: left;
  padding: 1em;
}
.new_chat_form .wbchat_id_input_wrapper label,
.new_chat_form .wbchat_id_input_wrapper input {
  display: block;
}
.new_chat_form .wbchat_id_input_wrapper input {
  margin: 0 0 1em 0;
}
.new_chat_form .wbchat_id_input_wrapper input[type=text],
.new_chat_form .wbchat_id_input_wrapper input[type=password] {
  width: 100%;
}
.new_chat_form .wbchat_id_input_wrapper input[type=submit] {
  margin: 2em auto 0;
}
/**
Shared
 */
input,
textarea {
  padding: 0.5em 1em;
}
.button {
  padding: 0.5em 1.5em;
  margin: 0.5em;
  border: none;
  background: #FF5259;
  color: #ffffff;
}
/**
Connection state
 */
.not_connected .disconnect_button,
.not_connected .wbchat_id_display,
.not_connected .message_form,
.not_connected #connected_users {
  display: none;
}
.not_connected .wbchat_id_input_wrapper {
  display: block;
}
.connected .disconnect_button,
.connected .wbchat_id_display,
.connected .message_form,
.connected #connected_users {
  display: initial;
}
.connected .message_form {
  display: block;
}
.connected .wbchat_id_input_wrapper {
  display: none;
}
#connected_users {
  font-size: 0.8em;
}
@media only screen and (max-width: 767px) {
  .connected .wbchat_id_display {
    display: none;
  }
}
/**
Messages
 */
ul.toast {
  display: none;
  list-style: none;
}
ul.toast li + li {
  padding: 0;
  margin-top: 1em;
}
.toast.error {
  display: block;
  padding: 1em;
  margin: 0 0 1em;
  font-size: 0.85em;
  animation: error_appear 0.5s;
  animation-fill-mode: forwards;
}
@keyframes error_appear {
  0% {
    background-color: #F0E6C2;
    color: #F0E6C2;
  }
  100% {
    background-color: #FFFFFF;
    color: #FF5259;
  }
}
/**
Transient notification
 */
.notification {
  position: absolute;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 3em;
  left: 0;
  top: -3em;
  transition: top 300ms cubic-bezier(0.17, 0.04, 0.03, 0.94) 0s;
  padding: 0.5em 1em;
  background: #FFFFFF;
  color: #333333;
  overflow: hidden;
  width: 100%;
}
.notification.visible {
  top: 0;
}
/**
Copy link
 */
button.copy_chat_link {
  display: flex;
  justify-items: center;
  align-items: center;
  margin: 0 0.3em;
  cursor: pointer;
  border: none;
  background: none;
}
svg.copy_chat_link {
  height: 16px;
  width: 16px;
  margin: 0 0.25em;
  fill: #333333;
}
svg.copy_chat_link:after {
  content: "Copy chat link to clipboard";
  display: inline-block;
  width: 100px;
  height: 20px;
}
.copy_chat_link_input {
  position: absolute;
  top: -9999px;
  left: -9999px;
}
/**
  Home page
 */
