#msk-chatbot-root {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 2147483647;
  font-family: Arial, Helvetica, sans-serif;
  color: #172033;
  pointer-events: auto;
  visibility: visible;
  box-sizing: border-box;
}

#msk-chatbot-root *,
#msk-chatbot-root *::before,
#msk-chatbot-root *::after {
  box-sizing: border-box;
}

#msk-chatbot-toggle,
#msk-chatbot-send,
#msk-chatbot-close,
#msk-chatbot-quick-replies button {
  font: inherit;
}

#msk-chatbot-toggle {
  background: #0f2742;
  color: #ffffff;
  border: none;
  border-radius: 999px;
  padding: 13px 18px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(15, 39, 66, 0.28);
  position: relative;
  z-index: 2147483647;
  pointer-events: auto;
  visibility: visible;
}

#msk-chatbot-toggle:hover {
  background: #173a5f;
}

#msk-chatbot-panel {
  display: none;
  position: relative;
  z-index: 2147483647;
  width: 400px;
  max-width: calc(100vw - 40px);
  max-height: min(600px, calc(100vh - 96px));
  background: #ffffff;
  border: 1px solid #d6e0ea;
  border-radius: 16px;
  box-shadow: 0 20px 54px rgba(15, 39, 66, 0.24);
  overflow: hidden;
  margin-bottom: 14px;
}

#msk-chatbot-panel.is-open {
  display: grid;
  grid-template-rows: auto minmax(190px, 1fr) auto auto;
}

.msk-chatbot-header {
  background: #0f2742;
  color: #ffffff;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.msk-chatbot-title {
  font-size: 15px;
  font-weight: 700;
}

.msk-chatbot-subtitle {
  font-size: 12px;
  opacity: 0.84;
  margin-top: 3px;
  line-height: 1.35;
}

#msk-chatbot-close {
  background: transparent;
  color: #ffffff;
  border: none;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  min-width: 34px;
  min-height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#msk-chatbot-close:hover {
  background: rgba(255, 255, 255, 0.12);
}

#msk-chatbot-messages {
  min-height: 220px;
  max-height: 340px;
  overflow-y: auto;
  padding: 14px;
  background: #f7f9fc;
}

.msk-chat-message {
  width: fit-content;
  max-width: 86%;
  border-radius: 13px;
  padding: 11px 13px;
  margin-bottom: 11px;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.msk-chat-message-bot {
  background: #ffffff;
  border: 1px solid #d9e2ec;
  color: #24384f;
}

.msk-chat-message-user {
  background: #0f2742;
  color: #ffffff;
  margin-left: auto;
}

.msk-chat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -2px 0 12px;
  max-width: 92%;
}

.msk-chat-action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #0f2742;
  background: #0f2742;
  color: #ffffff;
  border-radius: 999px;
  padding: 8px 11px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.msk-chat-action-link:hover,
.msk-chat-action-link:focus {
  background: #173a5f;
  border-color: #173a5f;
  color: #ffffff;
  text-decoration: none;
}

.msk-chat-typing {
  color: #61758f;
  font-style: italic;
}

#msk-chatbot-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  overflow-x: auto;
  max-height: 86px;
  padding: 10px 12px;
  border-top: 1px solid #e6edf5;
  background: #ffffff;
  scrollbar-width: thin;
}

#msk-chatbot-quick-replies button {
  flex: 0 1 auto;
  border: 1px solid #bfd0e2;
  background: #f8fafc;
  color: #173a5f;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  cursor: pointer;
  white-space: nowrap;
}

#msk-chatbot-quick-replies button:hover {
  border-color: #0f2742;
  background: #edf4fb;
}

#msk-chatbot-composer {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid #e6edf5;
  background: #ffffff;
}

#msk-chatbot-input {
  min-width: 230px;
  flex: 1 1 auto;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  min-height: 44px;
  padding: 11px 12px;
  font-size: 14px;
  line-height: 1.35;
  color: #172033;
  outline: none;
}

#msk-chatbot-input:focus {
  border-color: #0f2742;
  box-shadow: 0 0 0 3px rgba(15, 39, 66, 0.12);
}

#msk-chatbot-input:disabled {
  background: #f1f5f9;
  cursor: not-allowed;
}

#msk-chatbot-send {
  flex: 0 0 72px;
  border: none;
  border-radius: 12px;
  background: #0f2742;
  color: #ffffff;
  min-height: 44px;
  padding: 11px 14px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

#msk-chatbot-send:hover {
  background: #173a5f;
}

#msk-chatbot-send:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

@media (max-width: 520px) {
  #msk-chatbot-root {
    right: 10px;
    bottom: 10px;
    left: 10px;
  }

  #msk-chatbot-panel {
    width: min(100%, 390px);
    max-width: calc(100vw - 20px);
    max-height: 68vh;
    border-radius: 14px;
    margin-left: auto;
    margin-bottom: 10px;
  }

  #msk-chatbot-panel.is-open {
    grid-template-rows: auto minmax(140px, 1fr) auto auto;
  }

  #msk-chatbot-messages {
    min-height: 150px;
    max-height: calc(68vh - 190px);
    padding: 12px;
  }

  .msk-chat-message {
    max-width: 92%;
    padding: 10px 12px;
    margin-bottom: 9px;
  }

  .msk-chat-actions {
    max-width: 100%;
    gap: 6px;
    margin-bottom: 10px;
  }

  .msk-chat-action-link {
    padding: 7px 9px;
    font-size: 11.5px;
  }

  #msk-chatbot-quick-replies {
    flex-wrap: nowrap;
    max-height: 70px;
    padding: 9px 10px;
    gap: 7px;
  }

  #msk-chatbot-quick-replies button {
    padding: 6px 9px;
    font-size: 11.5px;
  }

  #msk-chatbot-composer {
    gap: 8px;
    padding: 10px;
  }

  #msk-chatbot-input {
    font-size: 13px;
    min-height: 40px;
    min-width: 0;
  }

  #msk-chatbot-send {
    flex-basis: 66px;
    min-height: 40px;
    padding: 9px 12px;
    font-size: 13px;
  }

  #msk-chatbot-toggle {
    float: right;
  }
}

@media (max-width: 360px) {
  #msk-chatbot-composer {
    flex-wrap: wrap;
  }

  #msk-chatbot-input,
  #msk-chatbot-send {
    flex: 1 1 100%;
    width: 100%;
  }
}
