  :root {
    --verde: #2d6a4f;
    --verde-claro: #52b788;
    --verde-muy-claro: #d8f3dc;
    --tierra: #b5682a;
    --crema: #fdf6ec;
    --gris: #555;
    --chat-w: 300px;
    --chat-h: 450px;
  }

  * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }

  body {
    font-family: 'DM Sans', sans-serif;
  }

  /* ── BURBUJA FLOTANTE ── */
  #chat-bubble {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 62px;
    height: 62px;
    background: var(--verde);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 24px rgba(45, 106, 79, .45);
    transition: transform .2s, box-shadow .2s;
    z-index: 9999;
  }

  #chat-bubble:hover {
    transform: scale(1.08);
    box-shadow: 0 10px 30px rgba(45, 106, 79, .55);
  }

  #chat-bubble svg {
    width: 30px;
    height: 30px;
    fill: white;
  }

  #badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--tierra);
    color: white;
    font-size: 11px;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
  }

  @keyframes pulse {

    0%,
    100% {
      transform: scale(1)
    }

    50% {
      transform: scale(1.2)
    }
  }

  /* ── VENTANA CHAT ── */
  #chat-window {
    position: fixed;
    bottom: 100px;
    right: 28px;
    width: var(--chat-w);
    height: var(--chat-h);
    background: var(--crema);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 9998;
    transform: scale(0) translateY(20px);
    transform-origin: bottom right;
    transition: transform .3s cubic-bezier(.34, 1.56, .64, 1), opacity .3s;
    opacity: 0;
    pointer-events: none;
  }

  #chat-window.open {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: all;
  }

  /* header */
  .chat-header {
    background: linear-gradient(135deg, var(--verde) 0%, #1b4332 100%);
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
  }

  .avatar {
    width: 42px;
    height: 42px;
    background: var(--verde-claro);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
  }

  .chat-header-info h3 {
    font-family: 'Playfair Display', serif;
    color: white;
    font-size: 15px;
    line-height: 1.2;
  }

  .chat-header-info p {
    color: var(--verde-claro);
    font-size: 12px;
    margin-top: 2px;
  }

  .online-dot {
    width: 8px;
    height: 8px;
    background: #74c69d;
    border-radius: 50%;
    display: inline-block;
    margin-right: 4px;
    animation: blink 2s infinite;
  }

  @keyframes blink {

    0%,
    100% {
      opacity: 1
    }

    50% {
      opacity: .4
    }
  }

  .close-btn {
    margin-left: auto;
    background: none;
    border: none;
    color: rgba(255, 255, 255, .7);
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    transition: color .2s;
  }

  .close-btn:hover {
    color: white;
  }

  /* mensajes */
  #messages-float {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
  }

  #messages-float::-webkit-scrollbar {
    width: 4px;
  }

  #messages-float::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
  }

  .msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    animation: fadeUp .3s ease;
  }

  @keyframes fadeUp {
    from {
      opacity: 0;
      transform: translateY(8px)
    }

    to {
      opacity: 1;
      transform: none
    }
  }

  .msg.bot {
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .07);
    align-self: flex-start;
  }

  .msg.user {
    background: var(--verde);
    color: white;
    border-bottom-right-radius: 4px;
    align-self: flex-end;
  }

  .msg.typing {
    display: flex;
    gap: 5px;
    align-items: center;
    padding: 12px 16px;
  }

  .dot {
    width: 7px;
    height: 7px;
    background: #aaa;
    border-radius: 50%;
    animation: bounce 1.2s infinite;
  }

  .dot:nth-child(2) {
    animation-delay: .2s
  }

  .dot:nth-child(3) {
    animation-delay: .4s
  }

  @keyframes bounce {

    0%,
    60%,
    100% {
      transform: translateY(0)
    }

    30% {
      transform: translateY(-6px)
    }
  }

  /* botones rápidos */
  .quick-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 16px 12px;
    animation: fadeUp .4s ease;
  }

  .qbtn {
    background: white;
    border: 1.5px solid var(--verde-claro);
    color: var(--verde);
    font-family: 'DM Sans', sans-serif;
    font-size: 10px;
    font-weight: 500;
    padding: 7px 13px;
    border-radius: 20px;
    cursor: pointer;
    transition: background .2s, color .2s, transform .1s;
  }

  .qbtn:hover {
    background: var(--verde);
    color: white;
    transform: scale(1.03);
  }

  /* input */
  .chat-input {
    display: flex;
    gap: 8px;
    padding: 12px 14px;
    border-top: 1px solid #e8e8e8;
    background: white;
    flex-shrink: 0;
  }

  #user-input-float {
    flex: 1;
    border: 1.5px solid #ddd;
    border-radius: 22px;
    padding: 9px 6px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    outline: none;
    transition: border .2s;
    background: var(--crema);
  }

  #user-input-float:focus {
    border-color: var(--verde-claro);
  }

  #send-btn-float {
    width: 38px;
    height: 38px;
    background: var(--verde);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s, transform .15s;
    flex-shrink: 0;
  }

  #send-btn-float:hover {
    background: #1b4332;
    transform: scale(1.08);
  }

  #send-btn-float svg {
    width: 16px;
    height: 16px;
    fill: white;
  }

  /* powered by */
  .powered {
    text-align: center;
    font-size: 10.5px;
    color: #bbb;
    padding: 6px 0 10px;
    background: white;
  }