#rfb-root { --rfb-color: #0a6c74; position: fixed; bottom: 18px; z-index: 99990; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Arabic", Arial, sans-serif; color: #1c2b2d; }
#rfb-root[data-pos="right"] { right: 18px; }
#rfb-root[data-pos="left"]  { left: 18px; }
#rfb-root *, #rfb-root *::before, #rfb-root *::after { box-sizing: border-box; }
#rfb-root [hidden] { display: none !important; }

.rfb-launcher { display: flex; align-items: center; justify-content: center; width: 58px; height: 58px; border: 0; border-radius: 50%; background: var(--rfb-color); color: #fff; cursor: pointer; box-shadow: 0 6px 18px rgba(0,0,0,.25); transition: transform .15s ease; }
.rfb-launcher:hover { transform: scale(1.06); }
.rfb-launcher:focus-visible, .rfb-close:focus-visible, .rfb-send:focus-visible, .rfb-chip:focus-visible, .rfb-input:focus-visible { outline: 3px solid #ffbf47; outline-offset: 2px; }
.rfb-hide { display: none; }

.rfb-panel { display: flex; flex-direction: column; width: 370px; max-width: calc(100vw - 24px); height: 540px; max-height: calc(100vh - 36px); background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 12px 40px rgba(0,0,0,.28); }
.rfb-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; background: var(--rfb-color); color: #fff; }
.rfb-title { font-weight: 600; }
.rfb-close { border: 0; background: transparent; color: #fff; font-size: 26px; line-height: 1; cursor: pointer; padding: 0 4px; }

.rfb-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: #f4f7f7; }
.rfb-msg { max-width: 86%; padding: 9px 12px; border-radius: 14px; word-wrap: break-word; overflow-wrap: anywhere; white-space: pre-wrap; }
.rfb-bot { align-self: flex-start; background: #fff; border: 1px solid #dde6e6; border-end-start-radius: 4px; }
.rfb-user { align-self: flex-end; background: var(--rfb-color); color: #fff; border-end-end-radius: 4px; }
.rfb-bot a { color: var(--rfb-color); font-weight: 600; }
.rfb-bot a[href^="tel:"], .rfb-bot a[href^="mailto:"] { direction: ltr; unicode-bidi: isolate; white-space: nowrap; }
.rfb-emergency { background: #fff1f0; border: 2px solid #c0281c; color: #5c110c; font-weight: 600; }
.rfb-emergency a { color: #a01d13; }
.rfb-emergency-btn { display: block; margin-top: 8px; padding: 9px 12px; text-align: center; text-decoration: none; background: #c0281c; color: #fff !important; border-radius: 10px; }
.rfb-error { border-color: #e0b4b0; }
.rfb-typing { opacity: .6; letter-spacing: 2px; animation: rfb-pulse 1s infinite ease-in-out; }
@keyframes rfb-pulse { 50% { opacity: .25; } }

.rfb-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 8px; background: #f4f7f7; }
.rfb-chips:empty { display: none; }
.rfb-chip { border: 1px solid var(--rfb-color); background: #fff; color: var(--rfb-color); border-radius: 18px; padding: 6px 11px; font: inherit; font-size: 13.5px; cursor: pointer; text-align: start; }
.rfb-chip:hover { background: var(--rfb-color); color: #fff; }

.rfb-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid #dde6e6; background: #fff; }
.rfb-input { flex: 1; min-width: 0; border: 1px solid #b9c7c8; border-radius: 22px; padding: 9px 14px; font: inherit; }
.rfb-send { border: 0; border-radius: 22px; padding: 0 16px; background: var(--rfb-color); color: #fff; font: inherit; cursor: pointer; }
.rfb-send:disabled { opacity: .5; cursor: default; }

.rfb-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 12px 10px; font-size: 12px; color: #55696b; background: #fff; }
.rfb-call { flex: none; color: var(--rfb-color); font-weight: 600; text-decoration: none; white-space: nowrap; }

@media (max-width: 480px) {
	#rfb-root { bottom: 10px; }
	#rfb-root[data-pos="right"] { right: 10px; }
	#rfb-root[data-pos="left"] { left: 10px; }
	.rfb-panel { width: calc(100vw - 20px); height: calc(100vh - 20px); }
}
@media (prefers-reduced-motion: reduce) { .rfb-launcher, .rfb-typing { transition: none; animation: none; } }
