/* بوت خدمة عملاء مكتب عهد الخليج — التنسيقات */

.kd-root {
  position: fixed;
  inset-block-end: 0;
  inset-inline-end: 24px;
  z-index: 2147483000;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  direction: rtl;
}

/* ---------- زر الفتح ---------- */
.kd-launcher {
  position: relative;
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #0f7a52, #14a06c);
  color: #fff;
  font-size: 26px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(15, 122, 82, .35);
  display: grid;
  place-items: center;
  transition: transform .18s ease;
}
.kd-launcher:hover { transform: scale(1.06); }

.kd-badge {
  position: absolute;
  inset-block-start: -4px;
  inset-inline-end: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: #e0483a;
  color: #fff;
  font-size: 12px;
  line-height: 20px;
  font-weight: 700;
}

/* ---------- اللوحة ---------- */
.kd-panel {
  position: absolute;
  inset-block-end: 70px;
  inset-inline-end: 0;
  width: 370px;
  max-width: calc(100vw - 32px);
  height: 560px;
  max-height: calc(100vh - 110px);
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .18);
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.kd-panel.kd-open { display: flex; }

/* ---------- الترويسة ---------- */
.kd-head {
  background: linear-gradient(135deg, #0f7a52, #14a06c);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
}
.kd-head-t { display: flex; flex-direction: column; gap: 2px; }
.kd-head-t b { font-size: 15px; font-weight: 700; }
.kd-head-t small { font-size: 11.5px; opacity: .85; }

.kd-x {
  border: 0;
  background: rgba(255, 255, 255, .18);
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}
.kd-x:hover { background: rgba(255, 255, 255, .3); }

/* ---------- الرسائل ---------- */
.kd-log {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 14px;
  background: #f2f5f4;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.kd-msg {
  max-width: 84%;
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.65;
  white-space: normal;
  word-break: break-word;
}

.kd-bot {
  align-self: flex-start;
  background: #fff;
  color: #1d2b26;
  border: 1px solid #dfe7e4;
  border-start-start-radius: 4px;
}

.kd-user {
  align-self: flex-end;
  background: #0f7a52;
  color: #fff;
  border-start-end-radius: 4px;
}

.kd-typing { display: flex; gap: 4px; align-items: center; padding: 12px 14px; }
.kd-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9db3ac;
  animation: kd-blink 1.3s infinite ease-in-out;
}
.kd-typing span:nth-child(2) { animation-delay: .2s; }
.kd-typing span:nth-child(3) { animation-delay: .4s; }

@keyframes kd-blink {
  0%, 60%, 100% { opacity: .3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

/* ---------- أزرار سريعة ---------- */
.kd-quickbar {
  flex: 0 0 auto;
  display: flex;
  gap: 6px;
  padding: 9px 12px;
  overflow-x: auto;
  background: #fff;
  border-block-start: 1px solid #e8eeec;
}
.kd-quickbar::-webkit-scrollbar { display: none; }

.kd-quick {
  flex: 0 0 auto;
  padding: 6px 12px;
  border: 1px solid #0f7a52;
  border-radius: 999px;
  background: #fff;
  color: #0f7a52;
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s ease;
}
.kd-quick:hover { background: #0f7a52; color: #fff; }

.kd-salesbtn {
  flex: 0 0 auto;
  padding: 6px 12px;
  border: 1px solid #25d366;
  border-radius: 999px;
  background: #fff;
  color: #12833f;
  font-size: 12.5px;
  font-family: inherit;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s ease;
}
.kd-salesbtn:hover { background: #25d366; color: #fff; }

/* ---------- زر واتساب ---------- */
.kd-extra {
  flex: 0 0 auto;
  padding: 10px 12px;
  background: #fff;
  border-block-start: 1px solid #e8eeec;
}
.kd-extra-btn {
  display: block;
  text-align: center;
  padding: 11px;
  border-radius: 10px;
  background: #25d366;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

/* ---------- الإدخال ---------- */
.kd-inputbar {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
  padding: 11px 12px;
  background: #fff;
  border-block-start: 1px solid #e8eeec;
}

.kd-inputbar input {
  flex: 1;
  padding: 10px 13px;
  border: 1px solid #d5dfdb;
  border-radius: 999px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  background: #f7faf9;
  color: #1d2b26;
}
.kd-inputbar input:focus {
  border-color: #0f7a52;
  background: #fff;
}

.kd-inputbar button {
  width: 42px;
  border: 0;
  border-radius: 50%;
  background: #0f7a52;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  flex: 0 0 auto;
}
.kd-inputbar button:hover { background: #0c6544; }

/* ---------- الجوال ---------- */
@media (max-width: 480px) {
  .kd-root { inset-inline-end: 14px; inset-block-end: 14px; }
  .kd-panel {
    inset-block-end: 66px;
    inset-inline-end: -6px;
    width: calc(100vw - 28px);
    height: calc(100vh - 130px);
    max-height: none;
  }
  .kd-launcher { width: 52px; height: 52px; font-size: 23px; }
  .kd-msg { max-width: 90%; font-size: 13px; }
}