/* Floating WhatsApp + chat assistant */
#dachat { position: fixed; right: 20px; bottom: 20px; z-index: 150; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.dc-fab { position: relative; width: 58px; height: 58px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; box-shadow: 0 8px 24px rgba(0, 0, 0, .28); transition: transform .2s, box-shadow .2s; text-decoration: none; }
.dc-fab:hover { transform: translateY(-3px) scale(1.05); box-shadow: 0 12px 30px rgba(0, 0, 0, .35); }
.dc-fab:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
.dc-wa { background: #25d366; }
.dc-wa::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid #25d366; animation: dcPulse 2.2s infinite; }
.dc-bot { background: var(--brand-grad); }
.dc-dot { position: absolute; top: 4px; right: 4px; width: 12px; height: 12px; border-radius: 50%; background: #25d366; border: 2px solid #fff; }
@keyframes dcPulse { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(1.6); opacity: 0; } }

.dc-panel { width: 360px; max-width: calc(100vw - 32px); height: 480px; max-height: calc(100vh - 150px); background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; animation: dcIn .22s ease; }
.dc-panel[hidden] { display: none; }
@keyframes dcIn { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
.dc-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--brand-grad); color: #fff; }
.dc-head b { display: block; font-size: 15px; }
.dc-head span { font-size: 12px; opacity: .9; display: flex; align-items: center; gap: 6px; }
.dc-head span i { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; display: inline-block; }
.dc-av { width: 38px; height: 38px; border-radius: 50%; background: rgba(255, 255, 255, .2); display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.dc-x { margin-inline-start: auto; background: none; border: 0; color: #fff; font-size: 26px; line-height: 1; cursor: pointer; padding: 0 4px; }
.dc-body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--bg-soft); }
.dc-msg { max-width: 85%; padding: 10px 13px; border-radius: 14px; font-size: 14px; line-height: 1.5; word-wrap: break-word; }
.dc-msg.bot { background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; align-self: flex-start; }
.dc-msg.me { background: var(--brand); color: #fff; border-bottom-right-radius: 4px; align-self: flex-end; }
.dc-msg a { color: var(--brand); font-weight: 600; text-decoration: underline; }
.dc-typing { display: flex; gap: 4px; padding: 14px; }
.dc-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: dcBlink 1s infinite; }
.dc-typing i:nth-child(2) { animation-delay: .15s; }
.dc-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes dcBlink { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }
.dc-chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 12px; border-top: 1px solid var(--line); background: var(--surface); }
.dc-chips button { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 999px; padding: 6px 12px; font-size: 12.5px; cursor: pointer; transition: .15s; }
.dc-chips button:hover { border-color: var(--brand); color: var(--brand); }
.dc-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--surface); }
.dc-form input { flex: 1; min-width: 0; border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 999px; padding: 10px 14px; font: inherit; font-size: 14px; }
.dc-form input:focus { outline: 2px solid var(--brand); border-color: transparent; }
.dc-form button { width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--brand); color: #fff; cursor: pointer; font-size: 16px; }

[dir="rtl"] #dachat { right: auto; left: 20px; align-items: flex-start; }
[dir="rtl"] .dc-msg.bot { border-bottom-left-radius: 14px; border-bottom-right-radius: 4px; }
[dir="rtl"] .dc-msg.me { border-bottom-right-radius: 14px; border-bottom-left-radius: 4px; }

@media (max-width: 520px) {
  #dachat { right: 12px; bottom: 12px; }
  .dc-fab { width: 52px; height: 52px; }
  .dc-panel { height: calc(100vh - 130px); }
}
@media (prefers-reduced-motion: reduce) { .dc-wa::after, .dc-panel { animation: none; } }
@media print { #dachat { display: none; } }
