/* Kmandi – widget chatbot */
:root { --kc-blue: #1e63b5; --kc-blue-dark: #174e91; }

.kc-launcher {
  position: fixed; right: 20px; bottom: 90px; z-index: 9998;
  width: 58px; height: 58px; border-radius: 50%; cursor: pointer; padding: 0;
  background: #fff; color: var(--kc-blue); border: 2px solid var(--kc-blue); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(0,0,0,.28); transition: transform .15s ease;
}
.kc-launcher:hover { transform: scale(1.06); background: #eef4fb; }
.kc-launcher:focus-visible { outline: 3px solid #f2b84b; outline-offset: 3px; }

.kc-panel {
  position: fixed; right: 20px; bottom: 160px; z-index: 9999;
  width: 340px; max-width: calc(100vw - 24px); height: 460px; max-height: calc(100vh - 190px);
  background: #fff; color: #1d2a2a; border-radius: 16px; overflow: hidden;
  box-shadow: 0 18px 50px rgba(0,0,0,.35); display: none; flex-direction: column;
  font-family: Inter, system-ui, sans-serif; font-size: 14px;
}
.kc-panel.open { display: flex; }

.kc-head { background: var(--kc-blue); color: #fff; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; }
.kc-head-l { display: flex; align-items: center; gap: 10px; }
.kc-avatar { width: 36px; height: 36px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.kc-head strong { font-size: 15px; display: block; }
.kc-head span { font-size: 12px; opacity: .85; }
.kc-close { background: none; border: none; color: #fff; font-size: 18px; cursor: pointer; padding: 4px 8px; }

.kc-body { flex: 1; overflow-y: auto; padding: 14px; background: #f5f3ee; display: flex; flex-direction: column; gap: 10px; }
.kc-msg { max-width: 85%; padding: 10px 12px; border-radius: 14px; line-height: 1.45; white-space: pre-line; word-wrap: break-word; }
.kc-msg.bot { background: #fff; align-self: flex-start; border-bottom-left-radius: 4px; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.kc-msg.user { background: var(--kc-blue); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.kc-msg a { color: inherit; font-weight: 600; text-decoration: underline; }

.kc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.kc-chip { background: #fff; border: 1px solid var(--kc-blue); color: var(--kc-blue); border-radius: 999px; padding: 6px 11px; font-size: 12.5px; cursor: pointer; }
.kc-chip:hover { background: var(--kc-blue); color: #fff; }
.kc-chip { text-decoration: none; }

.kc-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid #e3dfd6; background: #fff; }
.kc-input { flex: 1; border: 1px solid #cfcac0; border-radius: 999px; padding: 9px 14px; font: inherit; outline: none; }
.kc-input:focus { border-color: var(--kc-blue); }
.kc-send { border: none; background: var(--kc-blue); color: #fff; border-radius: 999px; padding: 0 16px; cursor: pointer; font-weight: 600; }

[dir="rtl"] .kc-launcher, [dir="rtl"] .kc-panel { right: auto; left: 20px; }
[dir="rtl"] .kc-msg.bot { align-self: flex-end; border-bottom-left-radius: 14px; border-bottom-right-radius: 4px; }
[dir="rtl"] .kc-msg.user { align-self: flex-start; border-bottom-right-radius: 14px; border-bottom-left-radius: 4px; }

@media (max-width: 480px) {
  .kc-panel { right: 12px; bottom: 150px; width: calc(100vw - 24px); }
  .kc-launcher { right: 14px; }
}