:root {
  --tg-bg: #ffffff;
  --tg-accent: #0088cc;
  --tg-user-msg: #dcf8c6;
  --tg-admin-msg: #f1f0f0;
  --tg-text: #444;
  --tg-text-light: #666;
  --tg-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
#chat-container {
    position: fixed;
    bottom: 30px;
    right: 40px;
    font-family: var(--tg-font);
    z-index: 10000;
}
#chat-toggle {
  background: linear-gradient(246deg, var(--color-mint-pink), var(--color-mint-pink-dark));
  color: black;
  font-weight: 600;
  border: none;
  font-size: 1.8vh;
  padding: 14px 20px;
  cursor: pointer;
  box-shadow: var(--tg-shadow);
  transition: background .2s ease;
}
#chat-toggle:hover {
  background: linear-gradient(246deg, #f55087, #3df4ec);
}
#chat-window {
    display: none;
    flex-direction: column;
    width: 350px;
    height: 580px;
    background: var(--tg-bg);
    border-radius: var(--tg-radius);
    box-shadow: var(--tg-shadow);
    overflow: hidden;
    margin-top: 10px;
}
#chat-window > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--tg-accent);
  color: #fff;
  padding: 10px 14px;
}
#chat-window > div:first-child strong {
  font-size: 1rem;
}
#chat-close {
  background: transparent;
  border: none;
  font-size: 1.2rem;
  color: #fff;
  cursor: pointer;
}
#chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  background: #fafafa;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.2) transparent;
}
#chat-messages::-webkit-scrollbar {
  width: 6px;
}
#chat-messages::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.2);
  border-radius: 3px;
}
#chat-messages .message {
  margin-bottom: 10px;
  max-width: 80%;
  padding: 8px 12px;
  border-radius: var(--tg-radius);
  position: relative;
  word-wrap: break-word;
  line-height: 1.4;
}
#chat-messages .message.user {
  background: var(--tg-user-msg);
  margin-left: auto;
  border-bottom-right-radius: 2px;
}
#chat-messages .message.admin {
  background: var(--tg-admin-msg);
  margin-right: auto;
  border-bottom-left-radius: 2px;
}
#chat-messages .message small {
  display: block;
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--tg-text-light);
  text-align: right;
}

#chat-input-area {
  padding: 10px 14px;
  border-top: 1px solid #eee;
  background: var(--tg-bg);
}
#chat-input-area textarea {
  width: 100%;
  height: 60px;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: var(--tg-radius);
  resize: none;
  font-family: var(--tg-font);
  line-height: 1.4;
}
#chat-input-area button {
  margin-top: 6px;
  width: 100%;
  padding: 10px;
  background: var(--tg-accent);
  color: #fff;
  border: none;
  border-radius: var(--tg-radius);
  cursor: pointer;
  transition: background .2s ease;
}
#chat-input-area button:hover {
  background: #007ab8;
}
#contact-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}
#contact-modal {
  background: var(--tg-bg);
  padding: 20px;
  border-radius: var(--tg-radius);
  box-shadow: var(--tg-shadow);
  width: 90%;
  max-width: 400px;
  position: relative;
  font-family: var(--tg-font);
}
#contact-modal h3 {
  margin-top: 0;
  margin-bottom: 15px;
  color: var(--tg-accent);
}
#contact-modal input {
  width: 100%;
  padding: 10px;
  margin-bottom: 10px;
  border: 1px solid #ddd;
  border-radius: var(--tg-radius);
  font-family: var(--tg-font);
}
#contact-modal button[type="submit"] {
  width: 100%;
  padding: 10px;
  background: var(--tg-accent);
  color: #fff;
  border: none;
  border-radius: var(--tg-radius);
  cursor: pointer;
}
#contact-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: transparent;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
}
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 8px;
}
.message-row {
  display: flex;
  align-items: flex-start;
  margin-bottom: 10px;
}
.message-content {
  padding: 8px 12px;
  border-radius: 5px;
  width: 80%;
  word-wrap: break-word;
}
.message-content.user {
  background-color: #e3f2fd;
}
.message-content.agent {
  background-color: #f1f0f0;
}
@media (max-width: 480px) {
  #chat-window {
    max-height: none;
    border-radius: 0;
    bottom: 0;
    right: 0;
    margin: 0;
  }
  #chat-container {
      position: fixed;
      bottom: 20px;
      right: 10px;
      font-family: var(--tg-font);
      z-index: 10000;
  }
  #chat-toggle {
    bottom: 10px;
    right: 10px;
  }
}
