  * { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', Arial, sans-serif; }
  body {
    background: #0f172a;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
  }
  body.embedded {
    background: transparent;
    padding: 0;
  }
  .chat-container {
    width: 100%;
    max-width: 420px;
    height: 640px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .chat-header {
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    color: white;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .chat-header .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
  }
  .chat-header .title { font-size: 15px; font-weight: 600; line-height: 1.3; }
  .chat-header .subtitle { font-size: 12px; opacity: 0.85; }
  .share-button, .close-button {
    padding: 7px 10px;
    border: 1px solid rgba(255,255,255,0.45);
    border-radius: 8px;
    background: rgba(255,255,255,0.14);
    color: #ffffff;
    font-size: 12px;
    cursor: pointer;
  }
  .share-button { margin-left: auto; }
  .close-button { margin-left: 6px; font-weight: 700; line-height: 1; padding: 7px 11px; }
  .close-button.hidden { display: none; }
  .share-button:hover, .close-button:hover { background: rgba(255,255,255,0.24); }
  .share-button:focus-visible, .close-button:focus-visible { outline: 2px solid #ffffff; outline-offset: 2px; }
  .chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f8fafc;
  }
  .msg {
    max-width: 82%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
  }
  .msg.bot {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    color: #1e293b;
  }
  .msg.user {
    background: #2563eb;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
  }
  .course-gallery {
    align-self: flex-start;
    width: 92%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 8px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    border-bottom-left-radius: 4px;
  }
  .course-gallery a {
    display: block;
    overflow: hidden;
    border-radius: 8px;
    background: #f1f5f9;
  }
  .course-gallery img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    transition: transform 0.2s ease, opacity 0.2s ease;
  }
  .course-gallery a:hover img,
  .course-gallery a:focus-visible img {
    transform: scale(1.04);
    opacity: 0.88;
  }
  .quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 16px 12px;
    background: #f8fafc;
  }
  .quick-reply {
    background: #eef2ff;
    color: #2563eb;
    border: 1px solid #c7d2fe;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 12.5px;
    cursor: pointer;
    transition: background 0.15s;
  }
  .quick-reply:hover { background: #e0e7ff; }
  .quick-reply.whatsapp {
    background: #dcfce7;
    color: #15803d;
    border-color: #bbf7d0;
  }
  .quick-reply.whatsapp:hover { background: #bbf7d0; }
  .typing {
    align-self: flex-start;
    display: flex;
    gap: 4px;
    padding: 12px 14px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    border-bottom-left-radius: 4px;
  }
  .typing span {
    width: 6px; height: 6px; border-radius: 50%;
    background: #94a3b8;
    animation: bounce 1.2s 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(-5px); } }
  .chat-input-area {
    display: flex;
    padding: 12px;
    border-top: 1px solid #e2e8f0;
    background: #ffffff;
    gap: 8px;
  }
  .chat-input-area input {
    flex: 1;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
  }
  .chat-input-area input:focus { border-color: #2563eb; }
  .chat-input-area button {
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }
  .chat-input-area button:hover { background: #1d4ed8; }
  .chat-messages::-webkit-scrollbar { width: 5px; }
  .chat-messages::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
