#matia-widget * { box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; margin: 0; padding: 0; }

#matia-btn {
  position: fixed; bottom: 28px; right: 28px; z-index: 9999;
  width: 60px; height: 60px; border-radius: 50%;
  background: #185FA5; border: none; cursor: pointer;
  box-shadow: 0 8px 32px rgba(24,95,165,0.18), 0 2px 8px rgba(0,0,0,0.10);
  transition: transform .2s, box-shadow .2s;
  display: flex; align-items: center; justify-content: center;
}
#matia-btn:hover { transform: scale(1.08); box-shadow: 0 12px 36px rgba(24,95,165,0.28); }
#matia-btn svg { width: 28px; height: 28px; fill: white; }
#matia-badge {
  position: absolute; top: -4px; right: -4px;
  background: #ef4444; color: white; border-radius: 50%;
  width: 20px; height: 20px; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid white; animation: matia-pulse 2s infinite;
}
@keyframes matia-pulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.15)} }

#matia-window {
  position: fixed; bottom: 104px; right: 28px; z-index: 9998;
  width: 370px; height: 540px; border-radius: 16px;
  background: #fff; box-shadow: 0 8px 32px rgba(24,95,165,0.18), 0 2px 8px rgba(0,0,0,0.10);
  display: flex; flex-direction: column; overflow: hidden;
  transform: scale(.9) translateY(20px); opacity: 0;
  transition: transform .25s cubic-bezier(.34,1.56,.64,1), opacity .2s;
  pointer-events: none;
}
#matia-window.open { transform: scale(1) translateY(0); opacity: 1; pointer-events: all; }

.matia-header {
  background: linear-gradient(135deg, #185FA5, #0C447C);
  padding: 14px 16px; display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}
.matia-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: 13px; color: white; flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.4);
}
.matia-header-info { flex: 1; }
.matia-header-name { color: white; font-weight: 600; font-size: 14px; }
.matia-header-status { display: flex; align-items: center; gap: 5px; margin-top: 2px; }
.matia-status-dot { width: 7px; height: 7px; border-radius: 50%; background: #4ade80; animation: matia-pulse 2s infinite; }
.matia-header-status span { color: rgba(255,255,255,0.8); font-size: 11px; }
.matia-close {
  background: rgba(255,255,255,0.15); border: none; cursor: pointer;
  width: 30px; height: 30px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; transition: background .2s;
}
.matia-close:hover { background: rgba(255,255,255,0.25); }
.matia-close svg { width: 16px; height: 16px; fill: white; }

#matia-messages {
  flex: 1; overflow-y: auto; padding: 16px; display: flex;
  flex-direction: column; gap: 10px; background: #fafbfc;
  scrollbar-width: thin; scrollbar-color: #B5D4F4 transparent;
}
#matia-messages::-webkit-scrollbar { width: 4px; }
#matia-messages::-webkit-scrollbar-thumb { background: #B5D4F4; border-radius: 4px; }

.matia-msg { display: flex; gap: 8px; max-width: 88%; animation: matia-fadeIn .25s ease; }
@keyframes matia-fadeIn { from{opacity:0;transform:translateY(6px)} to{opacity:1;transform:none} }
.matia-msg.bot { align-self: flex-start; }
.matia-msg.user { align-self: flex-end; flex-direction: row-reverse; }
.matia-msg-avatar {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  background: #EBF4FC; border: 1.5px solid #B5D4F4;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: #185FA5; margin-top: 2px;
}
.matia-msg-bubble { padding: 10px 14px; border-radius: 16px; font-size: 13.5px; line-height: 1.55; max-width: 100%; }
.matia-msg.bot .matia-msg-bubble {
  background: white; color: #1a3a5c;
  border: 1px solid #e8eef5; border-bottom-left-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.matia-msg.user .matia-msg-bubble { background: #185FA5; color: white; border-bottom-right-radius: 4px; }

.matia-typing-dots { display: flex; gap: 4px; padding: 14px 16px; }
.matia-typing-dots span {
  width: 7px; height: 7px; border-radius: 50%; background: #B5D4F4;
  animation: matia-bounce .9s infinite;
}
.matia-typing-dots span:nth-child(2) { animation-delay: .15s; }
.matia-typing-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes matia-bounce { 0%,80%,100%{transform:translateY(0)} 40%{transform:translateY(-6px)} }

.matia-suggestions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.matia-suggestion-btn {
  background: #EBF4FC; color: #185FA5; border: 1px solid #B5D4F4;
  border-radius: 20px; padding: 5px 12px; font-size: 12px; cursor: pointer;
  transition: background .15s, transform .1s; white-space: nowrap;
}
.matia-suggestion-btn:hover { background: #B5D4F4; transform: scale(1.02); }

.matia-input-area {
  padding: 12px 14px; border-top: 1px solid #e8eef5;
  display: flex; gap: 8px; align-items: flex-end; background: white; flex-shrink: 0;
}
#matia-input {
  flex: 1; border: 1.5px solid #e0eaf5; border-radius: 22px;
  padding: 10px 14px; font-size: 13.5px; color: #1a3a5c;
  outline: none; resize: none; max-height: 100px; overflow-y: auto;
  transition: border-color .2s; line-height: 1.4; font-family: inherit;
  scrollbar-width: none;
}
#matia-input:focus { border-color: #185FA5; }
#matia-input::placeholder { color: #9eb5cc; }
#matia-send {
  width: 40px; height: 40px; border-radius: 50%; background: #185FA5;
  border: none; cursor: pointer; display: flex; align-items: center;
  justify-content: center; flex-shrink: 0; transition: background .2s, transform .15s;
}
#matia-send:hover { background: #0C447C; transform: scale(1.05); }
#matia-send:disabled { background: #B5D4F4; cursor: not-allowed; transform: none; }
#matia-send svg { width: 18px; height: 18px; fill: white; }

@media (max-width: 480px) {
  #matia-window { width: 100vw; height: 100dvh; bottom: 0; right: 0; border-radius: 0; }
  #matia-btn { bottom: 20px; right: 20px; }
}
