/* مساعد اوليكس — زر عائم ونافذة محادثة بهوية اوليكس.
   ملف مستقل يُحمَّل في صفحة اوليكس وفي اللوحة؛ كل الأسماء تبدأ بـ ox-
   فلا تتصادم مع أنماط أيٍّ منهما. العربية بلا تباعد حروف. */

.ox-assist {
  --ox-brand: #216A5E;
  --ox-brand-2: #2A8274;
  --ox-deep: #0E2A26;
  --ox-deeper: #091D1A;
  --ox-spark: #4FD2E8;
  --ox-ink: #EAF4F2;
  --ox-muted: #9DB8B3;
  --ox-line: rgba(234, 244, 242, 0.10);
  --ox-font: 'Readex Pro', 'IBM Plex Sans Arabic', system-ui, sans-serif;
  /* مكان زر واتساب العائم نفسه — المساعد يحلّ محلّه */
  --ox-gap: 28px;
  --ox-lift: 28px;

  position: fixed;
  z-index: 9500;
  inset-inline-end: var(--ox-gap);
  bottom: var(--ox-lift);
  font-family: var(--ox-font);
  color: var(--ox-ink);
  line-height: 1.7;
}

/* صفحة اوليكس: المساعد بديل زر واتساب العائم، وواتساب داخل النافذة.
   الإخفاء مشروط بوجود المساعد: بلا مفتاح لا يُطبع المساعد فيعود الزر كما كان */
body:has(.ox-assist[data-audience="visitor"]) .wa-float { display: none; }

@media (max-width: 768px) {
  .ox-assist[data-audience="visitor"] { --ox-lift: 18px; }
}

/* في اللوحة: الزر في الزاوية، وشريط «حفظ» الثابت يفسح له مكاناً في
   طرفه فلا يغطّي الزرُّ زرَّ الحفظ أينما كان التمرير */
.ox-assist[data-audience="owner"],
.ox-assist[data-audience="admin"] {
  --ox-gap: 20px;
  --ox-lift: 14px;
}
body:has(.ox-assist) .o-savebar { padding-inline-end: 96px; }

.ox-assist *,
.ox-assist *::before,
.ox-assist *::after { box-sizing: border-box; }

/* ===== الشخصية: صورة الروبوت وطبقات الحركة فوقها =====
   المواضع نسب مئوية من الصورة نفسها، فتصحّ بأي حجم. */
.ox-mascot {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
}
.ox-mascot img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}
.ox-mascot i { position: absolute; display: block; pointer-events: none; }

/* الجسم: ميل ثلاثي الأبعاد هادئ نحو المؤشر — الطفو على الغلاف، والميل هنا */
.ox-body {
  position: absolute;
  inset: 0;
  transform: perspective(420px) rotateY(calc(var(--ex) * 28deg)) rotateX(calc(var(--ey) * -18deg));
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.25, 1);
  transform-style: preserve-3d;
}

/* لمعة تنزلق على المعدن عكس اتجاه النظرة — إحساس بالضوء والفخامة */
.ox-sheen {
  inset: 14% 12% 18%;
  border-radius: 50%;
  background: radial-gradient(40% 32% at 38% 30%, rgba(255, 255, 255, 0.26), transparent 70%);
  mix-blend-mode: screen;
  transform: translate(calc(var(--ex) * -12%), calc(var(--ey) * -9%));
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.25, 1);
}

/* الالتفات للجنب: دوران حقيقي لا تبديل صور.
   الوجه الأمامي يدور نحو الجهة ويتلاشى، والمنظر الجانبي يدخل مكملاً نفس
   الدوران — فيبدو الرأس يلتفت. --dir: 1 لليمين، -1 لليسار (المرآة). */
.ox-mascot { --dir: 1; }
.ox-mascot.is-turn-left { --dir: -1; }
.ox-mascot .ox-front,
.ox-mascot .ox-turn {
  backface-visibility: hidden;
  transform-origin: 50% 55%;
  transition:
    opacity 0.55s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.75s cubic-bezier(0.22, 0.8, 0.28, 1);
  will-change: transform, opacity;
}
.ox-mascot .ox-front { transform: perspective(620px) rotateY(0deg); }
.ox-mascot .ox-turn {
  opacity: 0;
  transform: perspective(620px) scaleX(var(--dir)) rotateY(-38deg) scale(0.97);
}
.ox-mascot.is-turn .ox-front {
  opacity: 0;
  transform: perspective(620px) rotateY(calc(var(--dir) * 34deg)) scale(0.98);
}
.ox-mascot.is-turn .ox-turn {
  opacity: 1;
  transform: perspective(620px) scaleX(var(--dir)) rotateY(0deg) scale(1);
}

/* العينان والابتسامة: تختفي بسرعة مع بداية اللف، وتعود بهدوء بعد الرجوع */
.ox-mascot .ox-eye,
.ox-mascot .ox-smile,
.ox-mascot .ox-sheen {
  transition:
    opacity 0.35s ease 0.3s,
    transform 0.18s cubic-bezier(0.25, 0.8, 0.3, 1);
}
.ox-mascot.is-turn .ox-eye,
.ox-mascot.is-turn .ox-smile,
.ox-mascot.is-turn .ox-sheen {
  opacity: 0;
  transition:
    opacity 0.12s ease,
    transform 0.18s cubic-bezier(0.25, 0.8, 0.3, 1);
}

/* أثناء الالتفات يخفّ ميل الجسم ثلاثي الأبعاد، فلا يتضاعف الدوران */
.ox-mascot.is-turn .ox-body {
  transform: perspective(420px) rotateY(calc(var(--ex) * 6deg)) rotateX(calc(var(--ey) * -8deg));
}

/* الشماغ الأحمر في الوضع الفاتح، والغترة البيضاء في الداكن واللوحة */
.ox-mascot .ox-skin--light { display: none; }
:is(body:not(.dark) .ox-assist[data-audience="visitor"], html[data-theme="light"] .ox-assist) .ox-mascot.has-light .ox-skin--light { display: block; }
:is(body:not(.dark) .ox-assist[data-audience="visitor"], html[data-theme="light"] .ox-assist) .ox-mascot.has-light .ox-skin--dark { display: none; }

/* العينان: مرسومتان هنا لا في الصورة، تتحركان داخل الشاشة نحو المؤشر.
   الوحدات cqw نسبة من عرض الروبوت، فالتوهّج يصحّ في كل حجم. */
.ox-eye {
  top: var(--eye-y);
  width: var(--eye-w);
  height: var(--eye-h);
  margin: calc(var(--eye-h) / -2) 0 0 calc(var(--eye-w) / -2);
  transform: translate(calc(var(--ex) * 3.4cqw), calc(var(--ey) * 2.6cqw));
  transition: transform 0.18s cubic-bezier(0.25, 0.8, 0.3, 1);
}
.ox-eye--l { left: var(--eye-lx); }
.ox-eye--r { left: var(--eye-rx); }
/* مواضع الوجه لكل صورة: الغترة البيضاء (الأساس) والشماغ الأحمر (الفاتح) */
.ox-mascot {
  --ex: 0;
  --ey: 0;
  --eye-y: 47.9%;
  --eye-lx: 52%;
  --eye-rx: 73.6%;
  --eye-w: 8.6%;
  --eye-h: 12%;
  --smile-x: 51%;
  --smile-y: 67%;
  --smile-w: 26%;
  container-type: inline-size;
}
:is(body:not(.dark) .ox-assist[data-audience="visitor"], html[data-theme="light"] .ox-assist) .ox-mascot.has-light {
  --eye-y: 49.8%;
  --eye-lx: 44.6%;
  --eye-rx: 67%;
  --eye-w: 8.4%;
  --eye-h: 11.6%;
  --smile-x: 44.2%;
  --smile-y: 69.4%;
  --smile-w: 24%;
}
.ox-eye b {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    repeating-linear-gradient(0deg, rgba(4, 40, 46, 0.35) 0 1px, transparent 1px 2.2cqw),
    radial-gradient(60% 55% at 45% 40%, #E8FFFF 0%, #8FF6FF 35%, #34D6EA 75%, #18A9C0 100%);
  box-shadow: 0 0 2.2cqw rgba(79, 230, 240, 0.85), 0 0 5cqw rgba(79, 230, 240, 0.35);
  animation: ox-blink 5.2s infinite;
  transform-origin: 50% 55%;
}
.ox-eye--r b { animation-delay: 0.04s; }
/* الوهج يتبع النظرة قليلاً: انعكاس أبيض صغير يزيد الحياة */
.ox-eye b::after {
  content: "";
  position: absolute;
  top: 18%;
  left: 24%;
  width: 26%;
  height: 20%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
}

.ox-smile {
  top: var(--smile-y);
  left: var(--smile-x);
  width: var(--smile-w);
  height: 9%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(79, 230, 240, 0.5), rgba(79, 230, 240, 0));
  mix-blend-mode: screen;
  animation: ox-glow 2.6s ease-in-out 0.4s infinite;
}

/* ===== الزر العائم: الروبوت نفسه يطفو بلا صندوق ===== */
.ox-fab {
  position: relative;
  width: 76px;
  height: 76px;
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ox-fab:focus-visible { outline: 2px solid var(--ox-spark); outline-offset: 4px; border-radius: 50%; }
.ox-mascot--fab {
  filter: drop-shadow(0 10px 14px rgba(9, 29, 26, 0.35));
  animation: ox-float 3.2s ease-in-out infinite, ox-hop 9s cubic-bezier(0.3, 0.7, 0.4, 1) 2.5s infinite;
  transition: transform 0.3s ease;
}
.ox-fab:hover .ox-mascot--fab { animation-play-state: paused; transform: translateY(-4px) rotate(-6deg) scale(1.06); }
.ox-fab-shadow {
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: -6px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(9, 29, 26, 0.35), transparent);
  animation: ox-shadow 3.2s ease-in-out infinite;
}

/* هالة تدعو للنقر — تتوقف حين تُفتح النافذة */
.ox-fab::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 2px solid rgba(79, 210, 232, 0.45);
  animation: ox-ring 2.8s ease-out infinite;
  pointer-events: none;
}
.ox-assist.is-open .ox-fab::before { animation: none; opacity: 0; }

.ox-fab-tip {
  position: absolute;
  bottom: 50%;
  inset-inline-end: calc(100% + 10px);
  transform: translateY(50%);
  white-space: nowrap;
  background: var(--ox-deep);
  color: var(--ox-ink);
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 10px;
  box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.ox-fab:hover .ox-fab-tip,
.ox-fab:focus-visible .ox-fab-tip { opacity: 1; }
.ox-assist.is-open .ox-fab-tip { display: none; }

/* ===== يفكّر: يهتز رأسه بخفة وتشتد عيناه ===== */
.ox-assist.is-thinking .ox-mascot--fab,
.ox-assist.is-thinking .ox-mascot--hero { animation: ox-think 0.9s ease-in-out infinite; }
.ox-assist.is-thinking .ox-eye { animation: ox-ponder 1.4s ease-in-out infinite; }

/* الروبوت الكبير في بداية المحادثة */
.ox-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 4px 8px 6px;
}
.ox-hero-title { margin: 6px 0 4px; font-size: 18px; font-weight: 700; }
.ox-hero-text { margin: 0; max-width: 280px; font-size: 13.5px; color: var(--ox-muted); line-height: 1.8; }
.ox-prompts-label { margin: 6px 2px 0; font-size: 12px; font-weight: 600; color: var(--ox-muted); }
.ox-mascot--hero {
  width: 112px;
  height: 112px;
  filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.45));
  animation: ox-float 3.2s ease-in-out infinite, ox-hello 1.1s ease-out 1;
}

/* ===== النافذة ===== */
.ox-panel {
  position: absolute;
  bottom: calc(100% + 14px);
  inset-inline-end: 0;
  width: 380px;
  height: min(580px, calc(100vh - var(--ox-lift) - 110px));
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  overflow: hidden;
  background:
    radial-gradient(140% 60% at 100% 0%, rgba(42, 130, 116, 0.35), transparent 60%),
    linear-gradient(180deg, var(--ox-deep), var(--ox-deeper));
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.6), inset 0 0 0 1px var(--ox-line);
  transform-origin: bottom right;
  animation: ox-in 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
[dir="rtl"] .ox-panel { transform-origin: bottom left; }
.ox-panel[hidden] { display: none; }

.ox-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--ox-line);
}
.ox-avatar {
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: radial-gradient(120% 120% at 30% 20%, rgba(42, 130, 116, 0.55), rgba(14, 42, 38, 0.4));
  box-shadow: inset 0 0 0 1px rgba(79, 210, 232, 0.3);
}
/* الصورة الصغيرة في رأس النافذة ثابتة تماماً: الحركة للروبوت الكبير وحده */
.ox-mascot--avatar { width: 38px; height: 38px; }
.ox-mascot--avatar .ox-body,
.ox-mascot--avatar .ox-eye,
.ox-mascot--avatar .ox-eye b,
.ox-mascot--avatar .ox-smile,
.ox-mascot--avatar .ox-sheen,
.ox-assist.is-thinking .ox-mascot--avatar,
.ox-assist.is-thinking .ox-mascot--avatar .ox-eye { animation: none !important; transform: none !important; transition: none !important; }
.ox-head-text { flex: 1; min-width: 0; }
.ox-head-text strong { display: block; font-size: 16px; font-weight: 600; }
.ox-head-text small { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ox-muted); }
.ox-head-text small::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3DDC97;
  box-shadow: 0 0 0 3px rgba(61, 220, 151, 0.18);
}
.ox-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: var(--ox-muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s ease, color 0.2s ease;
}
.ox-icon-btn:hover { background: rgba(234, 244, 242, 0.08); color: var(--ox-ink); }
.ox-icon-btn:focus-visible { outline: 2px solid var(--ox-spark); }
.ox-icon-btn svg { width: 18px; height: 18px; }


.ox-log {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(234, 244, 242, 0.15) transparent;
}

.ox-msg {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  animation: ox-rise 0.22s ease-out;
}
.ox-msg--bot {
  align-self: flex-start;
  background: rgba(234, 244, 242, 0.07);
  border: 1px solid var(--ox-line);
  border-start-start-radius: 6px;
}
.ox-msg--user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--ox-brand-2), var(--ox-brand));
  color: #fff;
  border-start-end-radius: 6px;
}
.ox-msg strong { color: #fff; font-weight: 600; }
.ox-msg--bot strong { color: var(--ox-spark); }

.ox-typing { display: inline-flex; gap: 5px; align-items: center; }
.ox-typing i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ox-spark);
  opacity: 0.4;
  animation: ox-dot 1.2s infinite;
}
.ox-typing i:nth-child(2) { animation-delay: 0.15s; }
.ox-typing i:nth-child(3) { animation-delay: 0.3s; }

/* ===== الاستفسار: شريط دائم، زر داخل المحادثة، لوحة النموذج، وبطاقات ===== */
.ox-contactbar {
  padding: 8px 12px 0;
  border-top: 1px solid var(--ox-line);
  background: rgba(9, 29, 26, 0.6);
}
.ox-contact-btn,
.ox-contact-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 12px;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.ox-contact-btn svg,
.ox-contact-inline svg { width: 17px; height: 17px; flex: none; }
.ox-contact-btn {
  width: 100%;
  justify-content: center;
  padding: 9px 14px;
  color: var(--ox-ink);
  background: linear-gradient(135deg, rgba(42, 130, 116, 0.35), rgba(33, 106, 94, 0.2));
  border: 1px solid rgba(79, 210, 232, 0.28);
}
.ox-contact-btn:hover { border-color: var(--ox-spark); background: linear-gradient(135deg, rgba(42, 130, 116, 0.55), rgba(33, 106, 94, 0.35)); }
.ox-contact-inline {
  align-self: flex-start;
  padding: 8px 14px;
  color: #fff;
  border: 0;
  background: linear-gradient(135deg, var(--ox-brand-2), var(--ox-brand));
  box-shadow: 0 8px 18px -10px rgba(79, 210, 232, 0.8);
}
.ox-contact-inline:hover { transform: translateY(-1px); }
.ox-form { border-top: 0; }

.ox-panel.has-sheet .ox-log,
.ox-panel.has-sheet .ox-contactbar,
.ox-panel.has-sheet .ox-form { visibility: hidden; }
.ox-sheet {
  position: absolute;
  inset: 75px 0 0;
  overflow-y: auto;
  padding: 16px;
  background: linear-gradient(180deg, var(--ox-deep), var(--ox-deeper));
  animation: ox-sheet 0.26s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.ox-sheet[hidden] { display: none; }
.ox-sheet-form { display: flex; flex-direction: column; gap: 10px; }
.ox-sheet-back {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px 4px 4px;
  font: inherit;
  font-size: 13px;
  color: var(--ox-muted);
  background: none;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}
.ox-sheet-back:hover { color: var(--ox-ink); background: rgba(234, 244, 242, 0.06); }
.ox-sheet-back svg { width: 16px; height: 16px; }
[dir="ltr"] .ox-sheet-back svg { transform: scaleX(-1); }
.ox-sheet-title { margin: 4px 0 0; font-size: 18px; font-weight: 600; }
.ox-sheet-intro { margin: 0 0 4px; font-size: 13px; color: var(--ox-muted); }
.ox-field {
  width: 100%;
  font: inherit;
  font-size: 14px;
  color: var(--ox-ink);
  background: rgba(234, 244, 242, 0.06);
  border: 1px solid var(--ox-line);
  border-radius: 12px;
  padding: 11px 14px;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.ox-field::placeholder { color: var(--ox-muted); }
.ox-field:focus { border-color: var(--ox-spark); background: rgba(234, 244, 242, 0.09); }
textarea.ox-field { resize: vertical; min-height: 110px; }
[dir="rtl"] .ox-field[dir="ltr"] { text-align: right; }
[dir="rtl"] .ox-field[dir="ltr"]::placeholder { direction: rtl; }
.ox-trap { position: absolute !important; width: 1px; height: 1px; opacity: 0; pointer-events: none; inset-inline-start: -9999px; }
.ox-sheet-error { margin: 0; min-height: 1em; font-size: 13px; color: #FF8A7A; }
.ox-sheet-send {
  margin-top: 2px;
  padding: 12px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  background: linear-gradient(135deg, var(--ox-brand-2), var(--ox-brand));
  box-shadow: 0 10px 24px -12px rgba(79, 210, 232, 0.8);
  transition: filter 0.2s ease, opacity 0.2s ease;
}
.ox-sheet-send:hover { filter: brightness(1.1); }
.ox-sheet-send:disabled { opacity: 0.6; cursor: default; }

.ox-sent {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(61, 220, 151, 0.1);
  border: 1px solid rgba(61, 220, 151, 0.35);
  animation: ox-rise 0.3s ease-out;
}
.ox-sent svg { width: 22px; height: 22px; flex: none; color: #3DDC97; }
.ox-sent strong { display: block; font-size: 14px; }
.ox-sent span { font-size: 13px; color: var(--ox-muted); }

.ox-card {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--ox-line);
  background: rgba(234, 244, 242, 0.04);
}
.ox-card-head { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.ox-card-head svg { width: 16px; height: 16px; color: var(--ox-spark); flex: none; }
.ox-card-head strong { font-weight: 600; }
.ox-card-state {
  margin-inline-start: auto;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 201, 107, 0.45);
  color: #FFC96B;
}
.ox-card--answered { border-color: rgba(79, 210, 232, 0.4); }
.ox-card--answered .ox-card-state { border-color: rgba(61, 220, 151, 0.5); color: #3DDC97; }
.ox-card--closed .ox-card-state { border-color: var(--ox-line); color: var(--ox-muted); }
.ox-card-msg { margin: 8px 0 0; font-size: 13px; color: var(--ox-muted); white-space: pre-wrap; }
.ox-card-reply {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  white-space: pre-wrap;
  background: rgba(79, 210, 232, 0.08);
  border-inline-start: 3px solid var(--ox-spark);
}

.ox-prompts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.ox-chip {
  align-self: flex-start;
  text-align: start;
  font: inherit;
  font-size: 13px;
  color: var(--ox-ink);
  background: transparent;
  border: 1px solid rgba(79, 210, 232, 0.35);
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  line-height: 1.5;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.ox-chip:hover { background: rgba(79, 210, 232, 0.10); border-color: var(--ox-spark); }

.ox-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--ox-line);
  background: rgba(9, 29, 26, 0.6);
}
.ox-input {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  overflow-y: auto;
  scrollbar-width: none;
  line-height: 1.6;
  box-shadow: none;
  background-clip: padding-box;
  flex: 1;
  min-height: 44px;
  max-height: 120px;
  resize: none;
  font: inherit;
  font-size: 14px;
  color: var(--ox-ink);
  background: rgba(234, 244, 242, 0.06);
  border: 1px solid var(--ox-line);
  border-radius: 14px;
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.2s ease;
}
.ox-input::placeholder { color: var(--ox-muted); opacity: 1; }
.ox-input::-webkit-scrollbar { display: none; }
.ox-input:focus { border-color: var(--ox-spark); }
.ox-send {
  width: 44px;
  height: 44px;
  flex: none;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, var(--ox-brand-2), var(--ox-brand));
  display: grid;
  place-items: center;
  transition: filter 0.2s ease, opacity 0.2s ease;
}
.ox-send:hover { filter: brightness(1.1); }
.ox-send:disabled { opacity: 0.45; cursor: default; }
.ox-send svg { width: 20px; height: 20px; }
[dir="rtl"] .ox-send svg { transform: scaleX(-1); }

/* ===== الجوال: النافذة تملأ الشاشة ===== */
@media (max-width: 600px) {
  .ox-assist { --ox-gap: 16px; }
  .ox-assist[data-audience="owner"],
  .ox-assist[data-audience="admin"] { --ox-lift: 12px; --ox-gap: 12px; }
  body:has(.ox-assist) .o-savebar { padding-inline-end: 80px; }
  .ox-fab { width: 64px; height: 64px; }
  .ox-fab-tip { display: none; }
  .ox-panel {
    position: fixed;
    inset: 0;
    width: auto;
    height: auto;
    border-radius: 0;
    animation: ox-up 0.3s ease-out;
  }
  .ox-head { padding-top: max(16px, env(safe-area-inset-top)); }
  .ox-form { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .ox-input { font-size: 16px; }
  .ox-assist.is-open .ox-fab { display: none; }
}

@keyframes ox-ring { 0% { transform: scale(0.92); opacity: 0.9; } 100% { transform: scale(1.18); opacity: 0; } }
@keyframes ox-blink { 0%, 91%, 97%, 100% { transform: scaleY(1); } 94% { transform: scaleY(0.08); } }
@keyframes ox-ponder { 0%, 100% { transform: translate(-2.4cqw, -1.8cqw); } 50% { transform: translate(2.4cqw, -1.8cqw); } }
@keyframes ox-glow { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }
@keyframes ox-float { 0%, 100% { translate: 0 0; rotate: 0deg; } 25% { rotate: 3deg; } 50% { translate: 0 -11px; rotate: 0deg; } 75% { rotate: -3deg; } }
/* قفزة لطيفة مع ميل رأس كل بضع ثوانٍ — تلفت النظر بلا إزعاج */
@keyframes ox-hop {
  0%, 82%, 100% { scale: 1 1; transform: none; }
  85% { scale: 1.08 0.9; transform: translateY(2px); }
  89% { scale: 0.94 1.08; transform: translateY(-16px) rotate(-10deg); }
  93% { scale: 1.03 0.97; transform: translateY(0) rotate(6deg); }
  96% { scale: 1 1; transform: rotate(-3deg); }
}
@keyframes ox-shadow { 0%, 100% { transform: scaleX(1); opacity: 1; } 50% { transform: scaleX(0.62); opacity: 0.45; } }
@keyframes ox-think { 0%, 100% { rotate: -9deg; translate: 0 -3px; } 50% { rotate: 9deg; translate: 0 2px; } }
@keyframes ox-hello { 0% { transform: scale(0.6) rotate(-12deg); opacity: 0; } 60% { transform: scale(1.06) rotate(6deg); opacity: 1; } 100% { transform: none; } }
@keyframes ox-in { from { opacity: 0; transform: translateY(10px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes ox-sheet { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes ox-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes ox-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes ox-dot { 0%, 80%, 100% { opacity: 0.3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

@media (prefers-reduced-motion: reduce) {
  .ox-assist *,
  .ox-assist *::before,
  .ox-assist *::after { animation: none !important; transition: none !important; }
}

/* ===== الوضع الفاتح في صفحة اوليكس: نافذة بيضاء مع الشماغ الأحمر =====
   نفس البناء، بألوان فاتحة: نص داكن، حدود رمادية خفيفة، ولمسات بلون
   الهوية. السماوي المتوهّج يصير أخضر الهوية لأنه لا يُقرأ على الأبيض. */
:is(body:not(.dark) .ox-assist[data-audience="visitor"], html[data-theme="light"] .ox-assist) {
  --ox-ink: #12201E;
  --ox-muted: #5E716D;
  --ox-line: rgba(18, 32, 30, 0.10);
  --ox-deep: #FFFFFF;
  --ox-deeper: #F6FAF9;
}
:is(body:not(.dark) .ox-assist[data-audience="visitor"], html[data-theme="light"] .ox-assist) .ox-panel {
  background:
    radial-gradient(140% 55% at 100% 0%, rgba(42, 130, 116, 0.10), transparent 60%),
    linear-gradient(180deg, #FFFFFF, #F6FAF9);
  box-shadow: 0 30px 70px -24px rgba(18, 32, 30, 0.35), inset 0 0 0 1px rgba(18, 32, 30, 0.08);
}
:is(body:not(.dark) .ox-assist[data-audience="visitor"], html[data-theme="light"] .ox-assist) .ox-avatar {
  background: radial-gradient(120% 120% at 30% 20%, #FFFFFF, #E6F1EE);
  box-shadow: inset 0 0 0 1px rgba(33, 106, 94, 0.18);
}
:is(body:not(.dark) .ox-assist[data-audience="visitor"], html[data-theme="light"] .ox-assist) .ox-icon-btn:hover { background: rgba(18, 32, 30, 0.06); }
:is(body:not(.dark) .ox-assist[data-audience="visitor"], html[data-theme="light"] .ox-assist) .ox-log { scrollbar-color: rgba(18, 32, 30, 0.18) transparent; }
:is(body:not(.dark) .ox-assist[data-audience="visitor"], html[data-theme="light"] .ox-assist) .ox-msg--bot {
  background: #F1F6F5;
  border-color: rgba(18, 32, 30, 0.06);
}
:is(body:not(.dark) .ox-assist[data-audience="visitor"], html[data-theme="light"] .ox-assist) .ox-msg--bot strong { color: var(--ox-brand); }
:is(body:not(.dark) .ox-assist[data-audience="visitor"], html[data-theme="light"] .ox-assist) .ox-typing i { background: var(--ox-brand); }
:is(body:not(.dark) .ox-assist[data-audience="visitor"], html[data-theme="light"] .ox-assist) .ox-chip {
  border-color: rgba(33, 106, 94, 0.30);
  background: #FFFFFF;
}
:is(body:not(.dark) .ox-assist[data-audience="visitor"], html[data-theme="light"] .ox-assist) .ox-chip:hover {
  background: rgba(33, 106, 94, 0.07);
  border-color: var(--ox-brand);
}
:is(body:not(.dark) .ox-assist[data-audience="visitor"], html[data-theme="light"] .ox-assist) .ox-contactbar,
:is(body:not(.dark) .ox-assist[data-audience="visitor"], html[data-theme="light"] .ox-assist) .ox-form { background: rgba(246, 250, 249, 0.9); }
:is(body:not(.dark) .ox-assist[data-audience="visitor"], html[data-theme="light"] .ox-assist) .ox-contact-btn {
  color: var(--ox-brand);
  background: rgba(33, 106, 94, 0.07);
  border-color: rgba(33, 106, 94, 0.25);
}
:is(body:not(.dark) .ox-assist[data-audience="visitor"], html[data-theme="light"] .ox-assist) .ox-contact-btn:hover {
  background: rgba(33, 106, 94, 0.12);
  border-color: var(--ox-brand);
}
:is(body:not(.dark) .ox-assist[data-audience="visitor"], html[data-theme="light"] .ox-assist) .ox-input,
:is(body:not(.dark) .ox-assist[data-audience="visitor"], html[data-theme="light"] .ox-assist) .ox-field {
  background: #FFFFFF;
  border-color: rgba(18, 32, 30, 0.14);
}
:is(body:not(.dark) .ox-assist[data-audience="visitor"], html[data-theme="light"] .ox-assist) .ox-input:focus,
:is(body:not(.dark) .ox-assist[data-audience="visitor"], html[data-theme="light"] .ox-assist) .ox-field:focus {
  border-color: var(--ox-brand);
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(33, 106, 94, 0.12);
}
:is(body:not(.dark) .ox-assist[data-audience="visitor"], html[data-theme="light"] .ox-assist) .ox-sheet { background: linear-gradient(180deg, #FFFFFF, #F6FAF9); }
:is(body:not(.dark) .ox-assist[data-audience="visitor"], html[data-theme="light"] .ox-assist) .ox-sheet-back:hover { background: rgba(18, 32, 30, 0.06); }
:is(body:not(.dark) .ox-assist[data-audience="visitor"], html[data-theme="light"] .ox-assist) .ox-sheet-error { color: #C0392B; }
:is(body:not(.dark) .ox-assist[data-audience="visitor"], html[data-theme="light"] .ox-assist) .ox-card { background: #FFFFFF; }
:is(body:not(.dark) .ox-assist[data-audience="visitor"], html[data-theme="light"] .ox-assist) .ox-card-head svg { color: var(--ox-brand); }
:is(body:not(.dark) .ox-assist[data-audience="visitor"], html[data-theme="light"] .ox-assist) .ox-card-state { color: #A8650F; border-color: rgba(168, 101, 15, 0.35); }
:is(body:not(.dark) .ox-assist[data-audience="visitor"], html[data-theme="light"] .ox-assist) .ox-card--answered { border-color: rgba(33, 106, 94, 0.35); }
:is(body:not(.dark) .ox-assist[data-audience="visitor"], html[data-theme="light"] .ox-assist) .ox-card--answered .ox-card-state { color: #1E8A57; border-color: rgba(30, 138, 87, 0.4); }
:is(body:not(.dark) .ox-assist[data-audience="visitor"], html[data-theme="light"] .ox-assist) .ox-card-reply {
  background: rgba(33, 106, 94, 0.07);
  border-inline-start-color: var(--ox-brand);
}
:is(body:not(.dark) .ox-assist[data-audience="visitor"], html[data-theme="light"] .ox-assist) .ox-sent {
  background: rgba(30, 138, 87, 0.08);
  border-color: rgba(30, 138, 87, 0.3);
}
:is(body:not(.dark) .ox-assist[data-audience="visitor"], html[data-theme="light"] .ox-assist) .ox-sent svg { color: #1E8A57; }
:is(body:not(.dark) .ox-assist[data-audience="visitor"], html[data-theme="light"] .ox-assist) .ox-mascot--hero { filter: drop-shadow(0 14px 18px rgba(18, 32, 30, 0.22)); }
:is(body:not(.dark) .ox-assist[data-audience="visitor"], html[data-theme="light"] .ox-assist) .ox-head-text small::before { background: #1E8A57; box-shadow: 0 0 0 3px rgba(30, 138, 87, 0.15); }

/* سطر الإفصاح أسفل النافذة */
.ox-note {
  margin: 0;
  padding: 0 14px 10px;
  font-size: 11px;
  text-align: center;
  color: var(--ox-muted);
  background: rgba(9, 29, 26, 0.6);
}
.ox-form { padding-bottom: 8px; }

/* الوضع الفاتح: رأس بلون الهوية فوق جسم أبيض — هيئة نوافذ الدعم الاحترافية */
:is(body:not(.dark) .ox-assist[data-audience="visitor"], html[data-theme="light"] .ox-assist) .ox-head {
  background: linear-gradient(135deg, #2A8274 0%, #216A5E 55%, #174E45 100%);
  border-bottom: 0;
  color: #fff;
  padding-bottom: 16px;
}
:is(body:not(.dark) .ox-assist[data-audience="visitor"], html[data-theme="light"] .ox-assist) .ox-head-text strong { color: #fff; }
:is(body:not(.dark) .ox-assist[data-audience="visitor"], html[data-theme="light"] .ox-assist) .ox-head-text small { color: rgba(255, 255, 255, 0.8); }
:is(body:not(.dark) .ox-assist[data-audience="visitor"], html[data-theme="light"] .ox-assist) .ox-head-text small::before { background: #7CF0B6; box-shadow: 0 0 0 3px rgba(124, 240, 182, 0.25); }
:is(body:not(.dark) .ox-assist[data-audience="visitor"], html[data-theme="light"] .ox-assist) .ox-head .ox-icon-btn { color: rgba(255, 255, 255, 0.8); }
:is(body:not(.dark) .ox-assist[data-audience="visitor"], html[data-theme="light"] .ox-assist) .ox-head .ox-icon-btn:hover { color: #fff; background: rgba(255, 255, 255, 0.14); }
:is(body:not(.dark) .ox-assist[data-audience="visitor"], html[data-theme="light"] .ox-assist) .ox-avatar {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 6px 14px -6px rgba(0, 0, 0, 0.35);
}
:is(body:not(.dark) .ox-assist[data-audience="visitor"], html[data-theme="light"] .ox-assist) .ox-note { background: rgba(246, 250, 249, 0.9); }
:is(body:not(.dark) .ox-assist[data-audience="visitor"], html[data-theme="light"] .ox-assist) .ox-hero-title { color: #12201E; }
:is(body:not(.dark) .ox-assist[data-audience="visitor"], html[data-theme="light"] .ox-assist) .ox-prompts-label { color: #5E716D; }
