/* =========================================================
   لمسة تك — «تواصل الآن» (الزرار العائم + نافذة المحادثة)
   مستقل بذاته عشان يشتغل على كل صفحات الموقع (الفاتح التلجي / الغامق الفضائي)
   ========================================================= */
:root {
  --lc-panel: rgba(252, 253, 255, .96); --lc-ink: #141a24; --lc-ink2: #525d6e; --lc-ink3: #8b95a5;
  --lc-line: rgba(20, 35, 60, .1); --lc-soft: rgba(20, 35, 60, .05); --lc-btn: #141a24; --lc-btn-ink: #fff;
  --lc-a1: #f0582a; --lc-a2: #f0476f; --lc-a3: #b0569a; --lc-bot: #ffffff; --lc-shadow: 0 30px 80px -30px rgba(40, 60, 100, .45);
  --lc-ease: cubic-bezier(.22, 1, .36, 1);
}
[data-theme="dark"] {
  --lc-panel: rgba(12, 15, 32, .96); --lc-ink: #eef1ff; --lc-ink2: #aab2cf; --lc-ink3: #6c7593;
  --lc-line: rgba(190, 205, 255, .13); --lc-soft: rgba(200, 210, 255, .07); --lc-btn: #eef1ff; --lc-btn-ink: #070914;
  --lc-a1: #6ea8ff; --lc-a2: #e879f9; --lc-a3: #a78bfa; --lc-bot: rgba(200, 210, 255, .08); --lc-shadow: 0 30px 80px -30px rgba(0, 0, 0, .9);
}

/* ---------- الزرار العائم ---------- */
.lc-fab {
  position: fixed; z-index: 75; left: 22px; bottom: calc(22px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 6px; border: 0; border-radius: 999px;
  background: var(--lc-btn); color: var(--lc-btn-ink); font: inherit; cursor: pointer;
  box-shadow: 0 20px 50px -16px rgba(0, 0, 0, .5); transition: transform .6s var(--lc-ease), opacity .4s;
}
.lc-fab::after { content: ''; position: absolute; inset: 0; border-radius: inherit; animation: lcPulse 2.6s ease-out infinite; pointer-events: none; }
@keyframes lcPulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--lc-a1) 40%, transparent); } 80%, 100% { box-shadow: 0 0 0 16px transparent; } }
.lc-fab:hover { transform: translateY(-3px); }
.lc-orb {
  width: 46px; height: 46px; flex: none; border-radius: 50%; background-color: var(--lc-a1);
  background-image: radial-gradient(ellipse 34% 22% at 32% 24%, rgba(255, 255, 255, .95), transparent 70%), radial-gradient(circle at 70% 75%, var(--lc-a2), transparent 60%), radial-gradient(circle at 30% 70%, var(--lc-a3), transparent 60%);
  box-shadow: inset 0 0 12px rgba(255, 255, 255, .35); animation: lcSpin 6s linear infinite;
}
@keyframes lcSpin { to { transform: rotate(360deg); } }
.lc-fab-t { font-size: 16px; font-weight: 400; white-space: nowrap; }
.lc-fab-ic { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--lc-btn-ink); color: var(--lc-btn); }
.lc-fab-ic svg, .lc-ib svg, .lc-send button svg, .lc-wa svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
html.intro-on .lc-fab, html.sheet-open .lc-fab, html.menu-open .lc-fab, html.lc-open .lc-fab { transform: translateY(160%); opacity: 0; pointer-events: none; }

/* ---------- النافذة ---------- */
.lc {
  position: fixed; z-index: 80; left: 22px; bottom: calc(22px + env(safe-area-inset-bottom));
  width: min(400px, calc(100vw - 32px)); height: min(620px, calc(100vh - 120px)); height: min(620px, calc(100dvh - 120px));
  display: flex; flex-direction: column; overflow: hidden; border-radius: 28px;
  background: var(--lc-panel); color: var(--lc-ink); border: 1px solid var(--lc-line); box-shadow: var(--lc-shadow);
  -webkit-backdrop-filter: blur(26px) saturate(150%); backdrop-filter: blur(26px) saturate(150%);
  font-family: inherit; font-weight: 300; line-height: 1.6; text-align: right;
  opacity: 0; transform: translateY(24px) scale(.97); transform-origin: bottom left; visibility: hidden;
  transition: opacity .35s var(--lc-ease), transform .5s var(--lc-ease), visibility 0s linear .5s;
}
.lc.open { opacity: 1; transform: none; visibility: visible; transition: opacity .35s var(--lc-ease), transform .5s var(--lc-ease), visibility 0s; }
.lc *, .lc *::before, .lc *::after { box-sizing: border-box; }
.lc-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--lc-line); flex: none; }
.lc-ava { width: 40px; height: 40px; flex: none; border-radius: 50%; background-color: var(--lc-a1); background-image: radial-gradient(ellipse 34% 22% at 32% 24%, rgba(255, 255, 255, .95), transparent 70%), radial-gradient(circle at 70% 75%, var(--lc-a2), transparent 60%), radial-gradient(circle at 30% 70%, var(--lc-a3), transparent 60%); }
.lc-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lc-who b { font-size: 15px; font-weight: 500; }
.lc-who small { font-size: 12px; color: var(--lc-ink2); display: inline-flex; align-items: center; gap: 6px; }
.lc-live { width: 7px; height: 7px; border-radius: 50%; background: #18b26b; box-shadow: 0 0 0 3px rgba(24, 178, 107, .18); }
.lc-ib { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--lc-line); background: var(--lc-soft); color: var(--lc-ink); cursor: pointer; }
.lc-ib[hidden] { display: none; }

.lc-body { flex: 1; overflow-y: auto; padding: 16px; overscroll-behavior: contain; scrollbar-width: thin; }
.lc-start { display: flex; flex-direction: column; gap: 12px; }
.lc-start[hidden], .lc-log[hidden], .lc-send[hidden], .lc-chips[hidden], .lc-err[hidden] { display: none; }
.lc-hi { margin: 0 0 4px; display: flex; flex-direction: column; gap: 4px; }
.lc-hi b { font-size: 18px; font-weight: 400; }
.lc-hi span { font-size: 14px; color: var(--lc-ink2); }
.lc-f { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--lc-ink2); }
.lc-f input, .lc-send textarea { width: 100%; font: inherit; font-size: 15px; color: var(--lc-ink); background: var(--lc-soft); border: 1px solid var(--lc-line); border-radius: 16px; padding: 12px 14px; outline: none; transition: border-color .2s, background-color .2s; }
.lc-f input:focus, .lc-send textarea:focus { border-color: color-mix(in srgb, var(--lc-a1) 60%, transparent); background: transparent; }
.lc-f input[dir="ltr"] { text-align: right; }
.lc-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.lc-err { margin: 0; font-size: 13px; color: #e2483d; }
.lc-go { min-height: 48px; border: 0; border-radius: 999px; background: var(--lc-btn); color: var(--lc-btn-ink); font: inherit; font-size: 15px; font-weight: 400; cursor: pointer; transition: transform .3s var(--lc-ease); }
.lc-go:hover { transform: translateY(-2px); }
.lc-go:disabled { opacity: .6; }
.lc-note { font-size: 12px; color: var(--lc-ink3); text-align: center; }

.lc-log { display: flex; flex-direction: column; gap: 10px; }
.lc-m { max-width: 86%; display: flex; flex-direction: column; gap: 6px; animation: lcIn .35s var(--lc-ease); }
@keyframes lcIn { from { opacity: 0; transform: translateY(8px); } }
.lc-m p { margin: 0; padding: 10px 14px; border-radius: 18px; font-size: 14.5px; line-height: 1.65; overflow-wrap: anywhere; }
.lc-m.bot { align-self: flex-start; }
.lc-m.bot p { background: var(--lc-bot); border: 1px solid var(--lc-line); border-start-start-radius: 6px; }
.lc-m.me { align-self: flex-end; }
.lc-m.me p { background: var(--lc-btn); color: var(--lc-btn-ink); border-start-end-radius: 6px; }
.lc-links { display: flex; flex-wrap: wrap; gap: 6px; }
.lc-links a { font-size: 13px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--lc-line); background: var(--lc-soft); color: var(--lc-ink); text-decoration: none; }
.lc-links a:hover { border-color: color-mix(in srgb, var(--lc-a1) 50%, transparent); }
.lc-typing p { display: flex; gap: 5px; align-items: center; min-height: 40px; }
.lc-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--lc-ink3); animation: lcDot 1.2s ease-in-out infinite; }
.lc-typing i:nth-child(2) { animation-delay: .15s; }
.lc-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes lcDot { 0%, 60%, 100% { opacity: .3; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }

.lc-done { margin: 14px 0 0; padding: 10px 14px; border-radius: 16px; font-size: 13px; line-height: 1.6; text-align: center; color: var(--lc-ink2); background: var(--lc-soft); border: 1px dashed var(--lc-line); }
.lc-done[hidden] { display: none; }
.lc-chips { display: flex; gap: 6px; padding: 0 16px 10px; overflow-x: auto; scrollbar-width: none; flex: none; }
.lc-chips::-webkit-scrollbar { display: none; }
.lc-chips button { flex: none; font: inherit; font-size: 13px; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--lc-line); background: var(--lc-soft); color: var(--lc-ink); cursor: pointer; white-space: nowrap; }
.lc-send { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--lc-line); flex: none; }
.lc-send textarea { resize: none; min-height: 46px; max-height: 120px; padding: 11px 14px; line-height: 1.5; }
.lc-send button { width: 46px; height: 46px; flex: none; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--lc-btn); color: var(--lc-btn-ink); cursor: pointer; }
.lc-send button svg { transform: scaleX(-1); }
.lc-wa { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 12px calc(9px + env(safe-area-inset-bottom)); font-size: 13px; color: var(--lc-ink2); text-decoration: none; border-top: 1px solid var(--lc-line); flex: none; }
.lc-wa:hover { color: var(--lc-ink); }
.lc-wa svg { width: 17px; height: 17px; color: #18b26b; }

@media (max-width: 640px) {
  .lc-fab { left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); transform: translateX(-50%); }
  .lc-fab:hover { transform: translateX(-50%); }
  html.intro-on .lc-fab, html.sheet-open .lc-fab, html.menu-open .lc-fab, html.lc-open .lc-fab, html.fab-tuck .lc-fab { transform: translate(-50%, 160%); opacity: 0; pointer-events: none; }
  .lc { left: 0; right: 0; bottom: 0; width: 100%; height: min(88vh, 100% - 40px); height: 88dvh; border-radius: 26px 26px 0 0; transform: translateY(40px); transform-origin: bottom center; }
}
@media (prefers-reduced-motion: reduce) { .lc-fab, .lc, .lc-orb, .lc-m, .lc-fab::after { animation: none !important; transition: none !important; } }
