/* ============================================================================
   EVA — المساعد الذكي (v30)
   ============================================================================ */
.eva-bot { position: fixed; z-index: 9990; width: 52px; height: 52px; padding: 0; border: 0; background: none; cursor: pointer; touch-action: none;
    transition: transform .35s cubic-bezier(.2, .8, .2, 1), opacity .3s, right .35s, left .35s; -webkit-tap-highlight-color: transparent; }
.eva-bot.side-right { right: 12px; } .eva-bot.side-left { left: 12px; }
.eva-bot[hidden] { display: none !important; }
.eb-face { position: relative; z-index: 2; width: 52px; height: 52px; border-radius: 18px; display: grid; place-items: center;
    background: linear-gradient(140deg, #3a1d6e, #6a3fb8 60%, #c9a24b); color: #fff; font-size: 25px;
    box-shadow: 0 10px 24px -8px rgba(43, 20, 87, .75), inset 0 0 0 2px rgba(255, 255, 255, .25); animation: ebFloat 4.5s ease-in-out infinite; }
.eb-face i { animation: ebTwinkle 3.2s ease-in-out infinite; filter: drop-shadow(0 0 6px rgba(255, 220, 140, .8)); }
.eb-ring { position: absolute; inset: -4px; border-radius: 22px; z-index: 1; background: conic-gradient(from 0deg, #f0cf7c, transparent 30%, #8b5cf6 60%, transparent 80%, #f0cf7c);
    opacity: .55; filter: blur(5px); animation: ebSpin 6s linear infinite; }
.eb-dot { position: absolute; z-index: 3; top: -2px; left: -2px; width: 12px; height: 12px; border-radius: 50%; background: #2ecc71; border: 2px solid #fff; }
.eva-bot.side-left .eb-dot { left: auto; right: -2px; }
.eva-bot:hover .eb-face, .eva-bot:focus-visible .eb-face { transform: scale(1.06); }
.eva-bot:focus-visible { outline: 3px solid #f0cf7c; outline-offset: 4px; border-radius: 20px; }
.eva-bot.dragging { transition: none; } .eva-bot.dragging .eb-face { animation: none; transform: scale(1.1); box-shadow: 0 18px 34px -10px rgba(43, 20, 87, .9); }
.eva-bot.is-open { opacity: 0; pointer-events: none; transform: scale(.6); }
/* مخبّأة نصفها خارج الشاشة (الهاتف) */
.eva-bot.tucked.side-right { transform: translateX(34px); opacity: .82; }
.eva-bot.tucked.side-left { transform: translateX(-34px); opacity: .82; }
.eva-bot.tucked .eb-face { animation: none; } .eva-bot.tucked .eb-ring { opacity: .25; }
.eva-bot.hello .eb-face { animation: ebHello .9s ease-in-out 3; }
.eb-tip { position: fixed; z-index: 9991; max-width: 230px; padding: 9px 13px; border-radius: 14px; background: #2b1457; color: #fff; font: 700 13px/1.6 'Tajawal', sans-serif;
    box-shadow: 0 12px 28px -10px rgba(0, 0, 0, .5); border: 1px solid #c9a24b; animation: ebIn .35s ease-out; }
@keyframes ebFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes ebTwinkle { 0%, 100% { transform: scale(1) rotate(0); } 50% { transform: scale(1.12) rotate(12deg); } }
@keyframes ebSpin { to { transform: rotate(360deg); } }
@keyframes ebHello { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }
@keyframes ebIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .eb-face, .eb-face i, .eb-ring { animation: none !important; } }
@media (max-width: 760px) { .eva-bot, .eb-face { width: 46px; height: 46px; } .eb-face { border-radius: 16px; font-size: 22px; } .eva-bot.side-right { right: 8px; } .eva-bot.side-left { left: 8px; } }
/* الطباعة والإدارة على الهاتف */
@media print { .eva-bot, .eb-panel { display: none !important; } }

/* النافذة */
.eb-panel { position: fixed; z-index: 100500; display: none; flex-direction: column; background: #fff; font-family: 'Tajawal', sans-serif; direction: rtl; overflow: hidden; }
.eb-panel.open { display: flex; animation: ebIn .25s ease-out; }
.eb-panel.is-float { bottom: 22px; right: 22px; width: 390px; height: min(600px, calc(100vh - 44px)); border-radius: 24px; box-shadow: 0 30px 70px -20px rgba(20, 8, 46, .55); border: 1px solid #ebe5f6; }
.eb-panel.is-float.at-left { right: auto; left: 22px; }
.eb-panel.is-sheet { left: 0; right: 0; bottom: 0; height: 78vh; height: 78dvh; border-radius: 22px 22px 0 0; box-shadow: 0 -20px 50px -10px rgba(20, 8, 46, .45); transition: transform .2s; }
html.eb-lock, html.eb-lock body { overflow: hidden; }
.eb-grab { display: none; height: 22px; flex: 0 0 auto; cursor: grab; touch-action: none; position: relative; background: linear-gradient(135deg, #1e0f40, #3a1f6e); }
.eb-grab::after { content: ''; position: absolute; top: 8px; left: 50%; width: 44px; height: 5px; margin-left: -22px; border-radius: 9px; background: rgba(255, 255, 255, .45); }
.eb-panel.is-sheet .eb-grab { display: block; }
.eb-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: linear-gradient(135deg, #1e0f40, #3a1f6e 70%, #5a34a0); color: #fff; border-bottom: 3px solid #c9a24b; flex: 0 0 auto; }
.eb-av { width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(140deg, #6a3fb8, #c9a24b); font-size: 21px; flex: 0 0 auto; }
.eb-head > div { flex: 1; min-width: 0; } .eb-head b { display: block; font-size: 16px; } .eb-head small { display: block; font-size: 12px; color: #d8cbf5; }
.eb-ic { width: 34px; height: 34px; border-radius: 10px; border: 0; background: rgba(255, 255, 255, .12); color: #fff; cursor: pointer; display: grid; place-items: center; font-size: 16px; flex: 0 0 auto; }
.eb-ic:hover { background: rgba(255, 255, 255, .22); }
.eb-body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: #f8f6fc; overscroll-behavior: contain; }
.eb-msg { display: flex; flex-direction: column; gap: 6px; max-width: 88%; }
.eb-msg.is-bot { align-self: flex-start; } .eb-msg.is-me { align-self: flex-end; align-items: flex-end; }
.eb-bub { padding: 10px 13px; border-radius: 16px; font-size: 14px; line-height: 1.75; color: #1c1433; background: #fff; border: 1px solid #ebe5f6; box-shadow: 0 4px 12px -10px rgba(43, 20, 87, .5); word-wrap: break-word; }
.eb-msg.is-bot .eb-bub { border-top-right-radius: 5px; }
.eb-msg.is-me .eb-bub { background: linear-gradient(135deg, #3a1d6e, #5a34a0); color: #fff; border: 0; border-top-left-radius: 5px; }
.eb-faq { display: block; margin-top: 6px; font-size: 11px; color: #a8822f; }
.eb-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.eb-act { display: inline-flex; align-items: center; gap: 5px; padding: 6px 11px; border-radius: 999px; border: 1.5px solid #c9b8ec; background: #fff; color: #3a1f6e; font: 800 12.5px 'Tajawal', sans-serif; cursor: pointer; }
.eb-act:hover { border-color: #c9a24b; background: #fffaf0; } .eb-act i { font-size: 16px; }
.eb-sugs { display: flex; flex-wrap: wrap; gap: 6px; }
.eb-sug { padding: 7px 12px; border-radius: 999px; border: 1px dashed #b9a2e6; background: #fff; color: #4b2a8f; font: 700 12.5px 'Tajawal', sans-serif; cursor: pointer; text-align: right; }
.eb-sug:hover { background: #f4f0fb; }
.eb-typing { display: inline-flex; gap: 4px; padding: 13px 15px; }
.eb-typing span { width: 7px; height: 7px; border-radius: 50%; background: #8b5cf6; animation: ebDots 1.1s infinite ease-in-out; }
.eb-typing span:nth-child(2) { animation-delay: .15s; } .eb-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes ebDots { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-4px); } }
.eb-form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid #ebe5f6; background: #fff; flex: 0 0 auto; }
.eb-form textarea { flex: 1; resize: none; min-height: 42px; max-height: 120px; padding: 10px 12px; border-radius: 14px; border: 1.5px solid #ebe5f6; background: #f8f6fc; font: 500 14.5px/1.5 'Tajawal', sans-serif; color: #1c1433; outline: 0; }
.eb-form textarea:focus { border-color: #c9a24b; background: #fff; }
.eb-form button { width: 44px; height: 44px; flex: 0 0 auto; border: 0; border-radius: 14px; background: linear-gradient(135deg, #3a1d6e, #6a3fb8); color: #fff; font-size: 19px; cursor: pointer; display: grid; place-items: center; }
.eb-form button i { transform: scaleX(-1); }
.eb-foot { padding: 6px 12px 10px; font-size: 11px; color: #8f87a8; background: #fff; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; flex: 0 0 auto; }
.eb-foot a { color: #4b2a8f; font-weight: 800; margin-inline-start: auto; }
.eb-panel.is-sheet .eb-foot { padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
