:root {
  --primary:   #003366;
  --cta:       #e6007e;
  --header-grad-start: var(--cta);
  --header-grad-end:   #c4006f;
  --bubble-radius: 12px;
}

/* OPEN BUTTON */
.chat-open {
  position: fixed;
  bottom: 60px;
  right: 20px;
  background: var(--cta);
  color: #fff;
  border: none;
  padding: .75rem 1.25rem;
  border-radius: 50px;
  font-weight: 600;
  cursor: pointer;
  z-index: 1001;
}

/* WIDGET BOX */
.chat-widget {
  display: none;
  flex-direction: column;
  position: fixed;
  bottom: 140px;
  right: 20px;
  width: 320px;
  height: 400px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  overflow: hidden;
  z-index: 1000;
  font-family: Arial, sans-serif;
}

/* HEADER */
.chat-header {
  display: flex;
  align-items: center;
  height: 56px;
  padding: 0 .75rem;
  background: linear-gradient(135deg, var(--header-grad-start), var(--header-grad-end));
  color: #fff;
}
.chat-title {
  flex: 1;
  font-weight: 600;
  font-size: 1rem;
  text-align: center;
  white-space: nowrap;
}
.chat-minimize {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
}

/* MESSAGE AREA */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  background: #f7f7f7;
}
.chat-messages .message {
  display: inline-block;
  margin: .4rem 0;
  padding: .5rem .75rem;
  max-width: 75%;
  border-radius: var(--bubble-radius);
  line-height: 1.3;
}
.chat-messages .incoming {
  background: #e1e5ea;
  color: var(--primary);
  border-top-left-radius: 0;
}
.chat-messages .outgoing {
  background: var(--cta);
  color: #fff;
  border-top-right-radius: 0;
  margin-left: auto;
}

/* INPUT ROW */
.chat-input {
  display: flex;
  align-items: center;
  padding: .5rem;
  border-top: 1px solid #ddd;
  background: #fff;
}
.chat-input .chat-attach {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  margin-right: .5rem;
}
.chat-input input {
  flex: 1;
  padding: .5rem 1rem;
  border: 1px solid #ccc;
  border-radius: 999px;
  outline: none;
}
.chat-input .chat-send {
  background: var(--cta);
  border: none;
  color: #fff;
  margin-left: .5rem;
  padding: .5rem .75rem;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
}
/* stacked, rounded bubbles with space and padding */

/* Base styles for both sides */
#chatMessages .incoming,
#chatMessages .outgoing {
  display: block;              /* force each on its own line */
  max-width: 50%;              /* don’t stretch all the way */
  padding: 0.75rem 1rem;       /* comfy padding */
  border-radius: 1rem;         /* fully rounded corners */
  margin: 1.5rem 0;            /* vertical gap between messages */
  line-height: 1.3;
  word-wrap: break-word;
}

/* left-aligned (Telegram → you) */
#chatMessages .incoming {
  background: #e1e5ea;
  color: var(--primary);
  margin-right: auto;          /* push it left */
}

/* right-aligned (you → Telegram) */
#chatMessages .outgoing {
  background: var(--cta);
  color: #fff;
  margin-left: auto;           /* push it right */
}

