.chat-container {
  border-radius: 8px;
  max-width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.messages {
  flex: 1;
  padding: 10px;
  overflow-y: auto;
  font-family: sans-serif;
}

.msg {
  margin: 5px 0;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 300;
}

.msg.user {
  background: #f0f2f5;
  align-self: flex-end;
  color: #1c293b;
  
}

.msg.bot {
  background: #f1f1f1;
  align-self: flex-start;
}

.msg.error {
  background: #ffebee;
  color: #b71c1c;
}

.chat-input {
  display: flex;
    align-items: center;
    border-top: 1px solid #eee;
    padding: 8px;
    background: #fff;
}
#chat-input{
  flex: 1;
    border: none;
    outline: none;
    padding: 10px 12px;
    border-radius: 20px;
    background: #f1f1f1;
    font-size: 14px;
    margin-bottom: 0px;
} 
.chat-input input {
  flex: 1;
  padding: 10px;
  border: none;
  outline: none;
}

.chat-input button {
  padding: 10px;
  border: none;
  background: #2196f3;
  color: #fff;
  cursor: pointer;
}

.chat-header {
    background: #0073aa;
    color: #fff;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
  }
  .chat-header .chat-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #fff;
    cursor: pointer;
  }

  .send-btn {
    background: #0073aa;
    border: none;
    border-radius: 50%;
    margin-left: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: background 0.3s;
  }
  .send-btn:hover {
    background: #005f8d;
  }

.gpt-chat-bubble-wrapper {
            position: fixed;
            top: 50%;
            right: 0;
            z-index: 9999;
        }

        .gpt-chat-toggle {
            background: #ffb201;
            color: #fff;
            border: none;
            border-radius: 5px 0 0 5px;
            width: 25px;
            height: 120px;
            transform: translateY(-50%); /* corregge l'allineamento verticale */
            display: flex;               /* per centrare il contenuto */
            justify-content: center;
            align-items: center;
            font-size: 16px;
            cursor: pointer;
            box-shadow: 0 4px 8px rgba(0,0,0,0.3);
            transition: background 0.3s;

        }
        .gpt-chat-toggle span{
          display: inline-block;
          transform: rotate(-90deg);
          white-space: nowrap; 
        }

        .gpt-chat-toggle:hover {
            background: #005f8d;
        }

        .gpt-chat-popup {
            position: fixed;
            bottom: 90px;
            right: 20px;
            width: 0;
            height: 0;
            background: #fff;
            border-radius: 12px;
            box-shadow: 0 4px 16px rgba(0,0,0,0.3);
            overflow: hidden;
            opacity: 0;
            transition: 
                width 0.4s ease,
                height 0.4s ease,
                opacity 0.3s ease;
        }

        .gpt-chat-popup.open {
            width: 350px;   /* larghezza finale */
            height: 450px;  /* altezza finale */
            opacity: 1;
        }

        /* contenuto interno prende tutto lo spazio */
        #gpt-chat-root {
            width: 100%;
            height: 100%;
        }