#dori-widget-root {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 999999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

#dori-bubble {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: #1f6f4d;
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  transition: transform .15s ease;
  position: relative;
}
#dori-bubble:hover { transform: scale(1.06); }
#dori-bubble svg { width: 30px; height: 30px; fill: #fff; }

#dori-bubble-label {
  position: absolute;
  right: 74px;
  top: 50%;
  transform: translateY(-50%);
  background: #fff;
  color: #1f6f4d;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,.18);
  white-space: nowrap;
  pointer-events: none;
  transition: opacity .15s ease;
}
#dori-bubble.panel-open #dori-bubble-label { display: none; }

#dori-panel {
  position: absolute;
  bottom: 76px;
  right: 0;
  width: 340px;
  max-width: 92vw;
  height: 480px;
  max-height: 75vh;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(0,0,0,.28);
  display: none;
  flex-direction: column;
  overflow: hidden;
}
#dori-panel.open { display: flex; }

#dori-header {
  background: #1f6f4d;
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
#dori-header .dori-title { font-weight: 600; font-size: 15px; }
#dori-header .dori-sub { font-size: 12px; opacity: .85; margin-top: 2px; }
#dori-header button {
  background: none; border: none; color: #fff; font-size: 18px; cursor: pointer; opacity: .9;
}

#dori-lang-toggle {
  display: flex; gap: 6px; padding: 8px 12px; border-bottom: 1px solid #eee; background: #fafafa;
}
#dori-lang-toggle button {
  border: 1px solid #ddd; background: #fff; border-radius: 20px; padding: 3px 10px; font-size: 12px; cursor: pointer; color: #555;
}
#dori-lang-toggle button.active { background: #1f6f4d; color: #fff; border-color: #1f6f4d; }

#dori-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  background: #f5f6f7;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dori-msg {
  max-width: 85%;
  padding: 9px 12px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.45;
  white-space: pre-wrap;
}
.dori-msg.bot {
  background: #fff;
  color: #1a1a1a;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 2px rgba(0,0,0,.08);
}
.dori-msg.user {
  background: #1f6f4d;
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.dori-msg a { color: inherit; text-decoration: underline; }
.dori-msg.bot a { color: #1f6f4d; }

.dori-typing {
  align-self: flex-start;
  background: #fff;
  padding: 10px 14px;
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  display: flex;
  gap: 4px;
}
.dori-typing span {
  width: 6px; height: 6px; border-radius: 50%; background: #bbb;
  animation: dori-blink 1.2s infinite ease-in-out;
}
.dori-typing span:nth-child(2) { animation-delay: .2s; }
.dori-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes dori-blink { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }

#dori-input-row {
  border-top: 1px solid #eee;
  padding: 8px;
  background: #fff;
}
#dori-input-row:has(textarea) {
  display: flex;
  gap: 8px;
}
#dori-input {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 20px;
  padding: 9px 14px;
  font-size: 13.5px;
  outline: none;
  resize: none;
}
#dori-input:focus { border-color: #1f6f4d; }
#dori-send {
  background: #1f6f4d;
  border: none;
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
#dori-send svg { width: 17px; height: 17px; fill: #fff; }

/* Mandatory contact form */
#dori-contact-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dori-contact-intro {
  font-size: 12px;
  color: #555;
  margin-bottom: 2px;
}
#dori-contact-form input {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  outline: none;
  width: 100%;
  box-sizing: border-box;
}
#dori-contact-form input:focus { border-color: #1f6f4d; }
#dori-contact-form input:invalid:not(:placeholder-shown) { border-color: #e0472c; }
#dori-contact-submit {
  background: #1f6f4d;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
#dori-contact-submit:disabled { opacity: .6; cursor: default; }

@media (max-width: 420px) {
  #dori-panel { width: 92vw; right: 4vw; }
  #dori-bubble-label { display: none; }
}
