/* Widget chat DEV74 — FAB + pannello (logo/stili allineati a TuaGPT Info Bot) */
.dev74-chat-root {
  position: fixed;
  left: 16px;
  right: auto;
  bottom: 16px;
  z-index: 1150;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  color: #f4f4f5;
}

.dev74-chat-fab {
  width: 56px;
  height: 56px;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: #09090B;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
  font-weight: 700;
  font-size: 14px;
}

.dev74-chat-fab img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: contain;
  display: block;
  background: transparent;
  padding: 0;
}

.dev74-chat-fab[aria-expanded="true"] {
  border-color: #ffffff;
  box-shadow: 0 0 0 1px rgba(253, 58, 37, 0.55), 0 0 0 4px rgba(253, 58, 37, 0.2);
}

.dev74-chat-panel {
  position: absolute;
  left: 0;
  right: auto;
  bottom: 68px;
  width: min(400px, calc(100vw - 32px));
  height: min(520px, calc(100vh - 120px));
  display: none;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: #121214;
  color: #f4f4f5;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.dev74-chat-panel.is-open {
  display: flex;
}

.dev74-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: #09090B;
}

.dev74-chat-head strong {
  font-size: 17px;
  font-weight: 600;
  color: #ffffff;
}

.dev74-chat-head span {
  display: block;
  font-size: 13px;
  color: #a1a1aa;
  margin-top: 3px;
}

.dev74-chat-close {
  border: 0;
  background: transparent;
  color: #a1a1aa;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  width: 32px;
  height: 32px;
}

.dev74-chat-log {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #0c0c0e;
}

.dev74-chat-msg {
  max-width: 92%;
  padding: 0.75rem 0.95rem;
  border-radius: 10px;
  font-size: 15px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  color: #f4f4f5;
}

.dev74-chat-msg-bot {
  align-self: flex-start;
  background: #1c1c1f;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.dev74-chat-msg-bot a {
  color: #fda4a5;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
}

.dev74-chat-msg-bot a:hover {
  color: #fecaca;
}

.dev74-chat-msg-user {
  align-self: flex-end;
  background: rgba(253, 58, 37, 0.22);
  border: 1px solid rgba(253, 58, 37, 0.35);
  color: #ffffff;
}

.dev74-chat-msg-err {
  align-self: stretch;
  background: rgba(127, 29, 29, 0.35);
  color: #fecaca;
  border: 1px solid rgba(252, 165, 165, 0.3);
  font-size: 15px;
}

.dev74-chat-loading {
  opacity: 0.9;
  color: rgba(255, 255, 255, 0.72);
}

.dev74-chat-typing {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 1.2em;
  padding: 2px 0;
}

.dev74-chat-typing i {
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  animation: dev74-chat-typing-bounce 1.2s infinite ease-in-out both;
}

.dev74-chat-typing i:nth-child(1) { animation-delay: 0s; }
.dev74-chat-typing i:nth-child(2) { animation-delay: 0.16s; }
.dev74-chat-typing i:nth-child(3) { animation-delay: 0.32s; }

@keyframes dev74-chat-typing-bounce {
  0%, 80%, 100% { transform: translateY(0) scale(0.75); opacity: 0.35; }
  40% { transform: translateY(-3px) scale(1); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .dev74-chat-typing i { animation: none; opacity: 0.7; }
}

.dev74-chat-form {
  display: flex;
  gap: 8px;
  padding: 12px 14px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: #121214;
}

.dev74-chat-root .dev74-chat-form input,
.dev74-chat-root .dev74-chat-form input[type="text"] {
  flex: 1 1 auto;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  border-radius: 8px;
  background: #1a1a1d !important;
  background-color: #1a1a1d !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  caret-color: #ffffff !important;
  padding: 0.7rem 0.85rem;
  font-size: 15px !important;
  line-height: 1.4;
  box-shadow: none !important;
}

.dev74-chat-root .dev74-chat-form input::placeholder {
  color: #a1a1aa !important;
  opacity: 1;
  -webkit-text-fill-color: #a1a1aa !important;
  font-size: 15px;
}

.dev74-chat-root .dev74-chat-form input:focus {
  outline: none;
  border-color: rgba(253, 58, 37, 0.65) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

.dev74-chat-root .dev74-chat-form button {
  flex: 0 0 auto;
  border: 0;
  border-radius: 8px;
  background: #FD3A25;
  color: #ffffff !important;
  padding: 0.7rem 1rem;
  font-size: 15px !important;
  font-weight: 600;
  cursor: pointer;
}

.dev74-chat-root .dev74-chat-form button:disabled {
  opacity: 0.55;
  cursor: default;
}

@media (max-width: 480px) {
  .dev74-chat-root {
    left: 10px;
    right: auto;
    bottom: 10px;
  }
  .dev74-chat-panel {
    bottom: 64px;
  }
  .dev74-chat-msg {
    font-size: 15px;
  }
}
