/* Hasanağa AI Chat Widget */
.hasana-chat-bubble {
  position: fixed; right: 18px; bottom: 18px; z-index: 99989;
  width: 56px; height: 56px; border-radius: 50%; border: none; cursor: pointer;
  background: #3d5435; color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(26,38,24,.3); transition: transform .15s, background .15s;
}
.hasana-chat-bubble:hover { background: #2c3f28; transform: scale(1.06); }
.hasana-chat-bubble svg { width: 26px; height: 26px; }

.hasana-chat-panel {
  position: fixed; right: 18px; bottom: 84px; z-index: 99989;
  width: 370px; max-width: calc(100vw - 24px); height: 540px; max-height: calc(100vh - 110px);
  background: #fff; border: 1px solid #d8e2d6; border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,.18); display: none; flex-direction: column; overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}
.hasana-chat-panel.open { display: flex; }

.hasana-chat-head {
  background: #3d5435; color: #fff; padding: 12px 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.hasana-chat-head .t { font-weight: 800; font-size: 15px; }
.hasana-chat-head .s { font-size: 11px; opacity: .75; display: block; }
.hasana-chat-head button {
  background: rgba(255,255,255,.12); border: none; color: #fff; border-radius: 8px;
  padding: 5px 10px; font-size: 11.5px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.hasana-chat-head button:hover { background: rgba(255,255,255,.22); }

.hasana-chat-body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: #f6f8f5; }

.hasana-chat-empty { margin: auto; color: #8a9784; font-size: 13px; text-align: center; padding: 20px 10px; }
.hasana-chat-msg { max-width: 85%; padding: 9px 12px; border-radius: 14px; font-size: 13.5px; line-height: 1.55; white-space: pre-wrap; word-wrap: break-word; }
.hasana-chat-msg.user { align-self: flex-end; background: #3d5435; color: #fff; border-bottom-right-radius: 4px; }
.hasana-chat-msg.bot { align-self: flex-start; background: #fff; border: 1px solid #e0e7de; color: #1a2618; border-bottom-left-radius: 4px; }
.hasana-chat-msg.bot a { color: #3d5435; font-weight: 600; }
.hasana-chat-msg.bot code { background: #eef2ea; padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.hasana-chat-msg.bot pre { background: #1a2618; color: #e8f0e6; padding: 8px 10px; border-radius: 8px; overflow-x: auto; font-size: 12px; }
.hasana-chat-msg.bot pre code { background: none; padding: 0; color: inherit; }
.hasana-chat-msg.bot strong { color: #2c3f28; }

.hasana-chat-typing { align-self: flex-start; color: #8a9784; font-size: 12px; padding: 4px 10px; }
.hasana-chat-typing::after { content: ''; animation: hcDots 1.2s steps(4) infinite; }
@keyframes hcDots { 0%{content:''} 25%{content:'.'} 50%{content:'..'} 75%{content:'...'} }

.hasana-chat-consent {
  margin: auto; max-width: 300px; text-align: center; padding: 8px;
}
.hasana-chat-consent p { font-size: 13px; color: #596b56; line-height: 1.6; margin: 0 0 14px; }
.hasana-chat-consent .btns { display: flex; gap: 8px; justify-content: center; }
.hasana-chat-consent button { padding: 9px 18px; border-radius: 999px; font-size: 13px; font-weight: 700; cursor: pointer; border: none; }
.hasana-chat-consent .ok { background: #3d5435; color: #fff; }
.hasana-chat-consent .no { background: #eef2ea; color: #596b56; }

.hasana-chat-foot { border-top: 1px solid #e6ece3; padding: 10px; display: flex; gap: 8px; background: #fff; }
.hasana-chat-foot textarea {
  flex: 1; border: 1px solid #d8e2d6; border-radius: 10px; padding: 9px 11px;
  font-size: 13.5px; font-family: inherit; resize: none; max-height: 90px; outline: none;
}
.hasana-chat-foot textarea:focus { border-color: #82a674; }
.hasana-chat-foot .send {
  background: #3d5435; color: #fff; border: none; border-radius: 10px;
  padding: 0 16px; font-weight: 700; font-size: 13px; cursor: pointer;
}
.hasana-chat-foot .send:disabled { background: #a9bfa3; cursor: default; }
.hasana-chat-note { font-size: 10.5px; color: #9aa48f; text-align: center; padding: 4px 0 8px; background: #fff; }

@media (max-width: 560px) {
  .hasana-chat-panel { right: 0; left: 0; bottom: 0; width: 100%; max-width: 100%;
    height: 78vh; max-height: 78vh; border-radius: 16px 16px 0 0; }
  .hasana-chat-bubble { right: 14px; bottom: 14px; }
}
