    /* --- Floating Toggle Button --- */
    #chat-toggle {
      position: fixed;
      bottom: 65px;
      right: 20px;
      width: 60px;
      height: 60px;
      border-radius: 50%;
      background: #25d366;
      color: white;
      border: none;
      cursor: pointer;
      box-shadow: 0 4px 15px rgba(0, 168, 132, 0.4);
      z-index: 1000;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: transform 0.3s ease, background 0.3s;
    }
    #chat-toggle:hover { transform: scale(1.1); background: #008f70; }

    /* --- Chat Container --- */
    .chat-container {
      position: fixed;
      bottom: 62px;
      right: 18px;
      width: 380px;
      max-width: 90vw;
      height: 480px;
      background: #fff;
      border-radius: 8px;
      box-shadow: 0 10px 30px rgba(0,0,0,0.15);
      display: flex;
      flex-direction: column;
      z-index: 9999;
      overflow: hidden;
      transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
      transform: translateY(20px);
      opacity: 0;
      pointer-events: none;
    }

    .chat-container.active {
      transform: translateY(0);
      opacity: 1;
      pointer-events: auto;
    }

    /* --- Header --- */
    .chat-header {
      background-color: #00a884;
      color: white;
      padding: 18px 20px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-weight: 800;
      font-size: 20px;
    }

    .status-dot {
      height: 8px;
      width: 8px;
      background-color: #00a884;
      border-radius: 50%;
      display: inline-block;
      margin-right: 8px;
      box-shadow: 0 0 5px #00a884;
    }

    .close-btn { cursor: pointer; font-size: 24px; line-height: 1; }

    /* --- Messages Area --- */
    .chat-messages {
      flex: 1;
      padding: 20px;
      overflow-y: auto;
      background: #fff;
      display: flex;
      flex-direction: column;
      gap: 15px;
    }

    .msg {
      padding: 12px 16px;
      font-size: 14px;
      line-height: 1.5;
      max-width: 80%;
      word-wrap: break-word;
      position: relative;
    }

    .user-msg {
      align-self: flex-end;
      background: #00a884;
      color: white;
      border-radius: 15px 15px 2px 15px;
    }

    .bot-msg {
      align-self: flex-start;
      background: #f0f0f0;
      color: #333333;
      border-radius: 15px 15px 15px 2px;
      border: 1px solid #e5e5e5;
    }

    /* --- Typing Animation --- */
    .typing { display: flex; gap: 4px; padding: 5px 0; }
    .typing span { width: 6px; height: 6px; background: #aaa; border-radius: 50%; animation: bounce 1.3s infinite; }
    .typing span:nth-child(2) { animation-delay: 0.2s; }
    .typing span:nth-child(3) { animation-delay: 0.4s; }
    @keyframes bounce { 
      0%, 60%, 100% { transform: translateY(0); } 
      30% { transform: translateY(-6px); background: #00a884; } 
    }

    /* --- Input Area --- */
    .chat-input {
      display: flex;
      padding: 15px;
      border-top: 1px solid #eee;
      background: #fff;
      gap: 10px;
    }

    .chat-input input {
      flex: 1;
      border: 1px solid #ddd;
      border-radius: 4px;
      padding: 10px 15px;
      outline: none;
      height: 40px;
      transition: border 0.3s;
      font-size: 16px;
    }

    .chat-input input:focus { border-color: #00a884; }

    .chat-input button {
      background: #00a884;
      color: white;
      border: none;
      border-radius: 8px;
      padding: 0 15px;
      height: 40px; 
      cursor: pointer;
      font-size: 15px;
      transition: background 0.3s, opacity 0.3s;
    }

    .chat-input button:disabled {
      background: #ccc;
      cursor: not-allowed;
    }

    .msg {
      white-space: pre-wrap;       /* Crucial for line breaks */
      word-wrap: break-word;       /* Prevents long text from breaking layout */
      display: block;              /* Ensures markdown blocks (like lists) stack */
    }

    /* Ensure the bubble respects line breaks and markdown spacing */
    .bot-msg {
      white-space: normal; /* marked.parse handles the spacing now */
    }

    .bot-msg p {
      margin-bottom: 10px;
    }

    .bot-msg p:last-child {
      margin-bottom: 0;
    }

    .bot-msg ul, .bot-msg ol {
      margin: 5px 0 10px 20px;
      padding: 0;
    }

    .bot-msg li {
      margin-bottom: 5px;
    }