/* ============ VALDO CHAT WIDGET ============ */
.valdo-root {
  --valdo-bg: #2a1810;
  --valdo-surface: #3d2418;
  --valdo-cream: #f4e8d8;
  --valdo-accent: #c9873d;
  --valdo-accent-hover: #d99a4f;
  --valdo-text: #f4e8d8;
  --valdo-text-muted: #b8a590;
  --valdo-user-bubble: #c9873d;
  --valdo-bot-bubble: #4a3426;
  --valdo-shadow: 0 10px 40px rgba(0,0,0,0.3);
  --valdo-font-display: 'Fraunces', Georgia, serif;
  --valdo-font-body: 'DM Sans', system-ui, sans-serif;
}

.valdo-fab {
  position: fixed;
  bottom: 172px;
  right: 20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--valdo-accent);
  color: var(--valdo-cream);
  border: 2px solid var(--valdo-cream);
  font-size: 26px;
  cursor: pointer;
  box-shadow: var(--valdo-shadow);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, background 0.2s ease;
  font-family: var(--valdo-font-body);
}

.valdo-fab:hover {
  transform: scale(1.08) rotate(-5deg);
  background: var(--valdo-accent-hover);
}

.valdo-fab.valdo-hidden {
  transform: scale(0);
  pointer-events: none;
}

.valdo-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: #e74c3c;
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  font-family: var(--valdo-font-body);
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.valdo-window {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 48px);
  height: 560px;
  max-height: calc(100vh - 48px);
  background: var(--valdo-bg);
  border-radius: 20px;
  box-shadow: var(--valdo-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 9999;
  font-family: var(--valdo-font-body);
  color: var(--valdo-text);
  transform-origin: bottom right;
  animation: valdoPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes valdoPop {
  0% { transform: scale(0.5) translateY(40px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

.valdo-window.valdo-hidden {
  display: none;
}

.valdo-header {
  background: linear-gradient(135deg, #3d2418, #2a1810);
  padding: 18px 20px;
  padding-top: calc(18px + env(safe-area-inset-top, 0px));
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid rgba(244,232,216,0.1);
}

.valdo-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--valdo-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  border: 2px solid var(--valdo-cream);
}

.valdo-header-info h3 {
  margin: 0;
  font-family: var(--valdo-font-display);
  font-weight: 600;
  font-size: 17px;
  color: var(--valdo-cream);
  letter-spacing: 0.3px;
}

.valdo-header-info p {
  margin: 2px 0 0 0;
  font-size: 12px;
  color: var(--valdo-text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.valdo-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px #4ade80;
}

.valdo-close {
  margin-left: auto;
  background: transparent;
  color: var(--valdo-cream);
  border: none;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  transition: opacity 0.2s, background 0.2s;
}

.valdo-close:hover {
  opacity: 1;
  background: rgba(244,232,216,0.1);
}

.valdo-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background:
    radial-gradient(ellipse at top, rgba(201,135,61,0.08), transparent 60%),
    var(--valdo-bg);
}

.valdo-messages::-webkit-scrollbar {
  width: 6px;
}

.valdo-messages::-webkit-scrollbar-track {
  background: transparent;
}

.valdo-messages::-webkit-scrollbar-thumb {
  background: rgba(244,232,216,0.15);
  border-radius: 3px;
}

.valdo-msg {
  max-width: 82%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 14.5px;
  line-height: 1.5;
  word-wrap: break-word;
  animation: valdoFadeIn 0.3s ease;
}

@keyframes valdoFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.valdo-msg-bot {
  background: var(--valdo-bot-bubble);
  color: var(--valdo-text);
  align-self: flex-start;
  border-bottom-left-radius: 6px;
}

.valdo-msg-user {
  background: var(--valdo-user-bubble);
  color: #2a1810;
  align-self: flex-end;
  border-bottom-right-radius: 6px;
  font-weight: 500;
}

.valdo-msg strong {
  font-weight: 600;
}

.valdo-msg p {
  margin: 0 0 6px 0;
}

.valdo-msg p:last-child {
  margin-bottom: 0;
}

.valdo-typing {
  display: flex;
  gap: 4px;
  padding: 14px 18px;
  background: var(--valdo-bot-bubble);
  border-radius: 18px;
  border-bottom-left-radius: 6px;
  align-self: flex-start;
  width: fit-content;
}

.valdo-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--valdo-text-muted);
  animation: valdoBounce 1.4s infinite;
}

.valdo-typing span:nth-child(2) { animation-delay: 0.2s; }
.valdo-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes valdoBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

.valdo-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.valdo-suggestion {
  background: transparent;
  border: 1px solid var(--valdo-accent);
  color: var(--valdo-accent);
  padding: 7px 13px;
  border-radius: 14px;
  font-size: 12.5px;
  font-family: var(--valdo-font-body);
  cursor: pointer;
  transition: all 0.2s;
}

.valdo-suggestion:hover {
  background: var(--valdo-accent);
  color: var(--valdo-bg);
}

.valdo-input-area {
  padding: 14px 16px;
  background: var(--valdo-surface);
  border-top: 1px solid rgba(244,232,216,0.1);
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.valdo-input {
  flex: 1;
  background: rgba(244,232,216,0.08);
  border: 1px solid rgba(244,232,216,0.15);
  color: var(--valdo-text);
  padding: 11px 14px;
  border-radius: 20px;
  font-family: var(--valdo-font-body);
  font-size: 14px;
  resize: none;
  outline: none;
  max-height: 100px;
  transition: border-color 0.2s;
}

.valdo-input:focus {
  border-color: var(--valdo-accent);
}

.valdo-input::placeholder {
  color: var(--valdo-text-muted);
}

.valdo-send {
  background: var(--valdo-accent);
  color: var(--valdo-bg);
  border: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.1s;
  flex-shrink: 0;
}

.valdo-send:hover:not(:disabled) {
  background: var(--valdo-accent-hover);
}

.valdo-send:active:not(:disabled) {
  transform: scale(0.95);
}

.valdo-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.valdo-footer {
  padding: 6px 16px 10px;
  background: var(--valdo-surface);
  text-align: center;
  font-size: 10.5px;
  color: var(--valdo-text-muted);
  letter-spacing: 0.3px;
}

@media (max-width: 480px) {
  .valdo-window {
    width: 100vw;
    height: 100dvh;
    max-width: 100vw;
    max-height: 100dvh;
    bottom: 0;
    right: 0;
    border-radius: 0;
  }
  .valdo-fab {
    bottom: 156px;
    right: 20px;
    width: 56px;
    height: 56px;
    font-size: 24px;
  }
}
