/* Live chat widget — Khayati landing */
.kh-chat-root {
  position: fixed;
  inset-inline-end: 22px;
  bottom: 22px;
  z-index: 1200;
  font-family: var(--font, "El Messiri", sans-serif);
}
.kh-chat-toggle {
  width: 58px;
  height: 58px;
  border: none;
  border-radius: 50%;
  background: #283756;
  color: #E8B472;
  box-shadow: 0 12px 30px rgba(20, 28, 44, 0.35);
  cursor: pointer;
  font-size: 1.35rem;
}
.kh-chat-panel {
  display: none;
  width: min(360px, calc(100vw - 28px));
  height: 480px;
  margin-bottom: 12px;
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(20, 28, 44, 0.28);
  border: 1px solid rgba(40, 55, 86, 0.08);
  flex-direction: column;
}
.kh-chat-root.is-open .kh-chat-panel { display: flex; }
.kh-chat-head {
  background: #283756;
  color: #FBF7EF;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.kh-chat-head-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.kh-chat-head strong { font-size: 1.05rem; }
.kh-chat-status {
  font-size: .8rem;
  color: #9ae6b4;
  font-weight: 700;
}
.kh-chat-status.is-offline {
  color: #E8B472;
}
.kh-chat-head button {
  border: none;
  background: transparent;
  color: #E8B472;
  font-size: 1.1rem;
  cursor: pointer;
}
.kh-chat-messages {
  flex: 1;
  overflow: auto;
  padding: 14px;
  background: #f7f4ef;
}
.kh-chat-bubble {
  max-width: 85%;
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  font-size: .95rem;
  line-height: 1.45;
  white-space: pre-wrap;
}
.kh-chat-bubble.is-bot,
.kh-chat-bubble.is-admin {
  background: #fff;
  color: #283756;
  border: 1px solid rgba(40,55,86,.08);
  margin-inline-end: auto;
}
.kh-chat-bubble.is-system {
  background: transparent;
  color: #6b7280;
  border: none;
  margin-inline: auto;
  text-align: center;
  font-size: .85rem;
  max-width: 95%;
}
.kh-chat-bubble-meta {
  font-size: .72rem;
  font-weight: 700;
  opacity: .7;
  margin-bottom: 4px;
}
.kh-chat-bubble.is-me {
  background: #283756;
  color: #FBF7EF;
  margin-inline-start: auto;
}
.kh-chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid rgba(40,55,86,.08);
  background: #fff;
}
.kh-chat-form input[type="text"] {
  border: 1px solid rgba(40,55,86,.15);
  border-radius: 12px;
  padding: 10px 12px;
  font-family: inherit;
}
.kh-chat-form button {
  border: none;
  border-radius: 12px;
  background: #E8B472;
  color: #283756;
  font-weight: 800;
  padding: 0 14px;
  cursor: pointer;
}
.kh-chat-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 10px 8px;
  background: #fff;
}
.kh-chat-meta input {
  border: 1px solid rgba(40,55,86,.12);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: .9rem;
  font-family: inherit;
}
@media (max-width: 576px) {
  .kh-chat-root {
    inset-inline-end: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
  }
  .kh-chat-toggle {
    width: 54px;
    height: 54px;
  }
  .kh-chat-root.is-open {
    inset: 0;
    inset-inline-end: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 10px;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    background: rgba(20, 28, 44, 0.35);
  }
  .kh-chat-root.is-open .kh-chat-toggle { display: none; }
  .kh-chat-panel {
    width: 100%;
    height: min(78vh, 640px);
    max-height: calc(100dvh - 24px - env(safe-area-inset-bottom));
    margin-bottom: 0;
    border-radius: 18px;
  }
  .kh-chat-form input[type="text"],
  .kh-chat-meta input {
    font-size: 16px;
  }
}
