#ccp-cb-react-root { direction: rtl; }

.ccp-cb-launch {
  position: fixed; left: 16px; bottom: 70px; z-index: 9990;
  width: 56px; height: 56px; display: flex; align-items: center; justify-content: center;
  padding: 0; border: none; border-radius: 50%; background: var(--ccp-cb-primary,#1f7a63); color: #fff;
  cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.25);
}
.ccp-cb-launch:hover { background: var(--ccp-cb-primary-hover,#19624f); }
.ccp-cb-launch:focus-visible { outline: 3px solid #111827; outline-offset: 2px; }
.ccp-cb-launch svg { width: 28px; height: 28px; fill: currentColor; display: block; }

.ccp-cb-panel {
  position: fixed; left: 16px; bottom: 138px; z-index: 9991;
  width: 360px; max-width: calc(100vw - 32px); max-height: 70vh;
  display: none; flex-direction: column; background: #fff; border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,.28); direction: rtl; overflow: hidden;
  font-family: inherit;
}
.ccp-cb-panel.is-open { display: flex; }
.ccp-cb-hidden { display: none !important; }

.ccp-cb-header {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--ccp-cb-primary,#1f7a63); color: #fff; padding: 12px 14px;
}
.ccp-cb-title { font-size: 16px; font-weight: 700; line-height: 1.2; }
.ccp-cb-close {
  background: transparent; border: none; color: #fff; font-size: 22px; line-height: 1;
  cursor: pointer; padding: 2px 6px; border-radius: 6px;
}
.ccp-cb-close:hover { background: rgba(255,255,255,.18); }
.ccp-cb-close:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }

.ccp-cb-tree { padding: 10px 12px; border-bottom: 1px solid #e5e7eb; background: #fff; }
.ccp-cb-tree-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.ccp-cb-tree-back {
  background: #eef5f2; color: var(--ccp-cb-primary,#1f7a63); border: 1px solid #cfe3db; border-radius: 14px;
  padding: 3px 10px; font: inherit; font-size: 13px; cursor: pointer;
}
.ccp-cb-tree-back:hover { background: #e0efe9; }
.ccp-cb-tree-crumb { font-size: 13px; color: var(--ccp-cb-crumb,#262b6f); font-weight: 600; }
.ccp-cb-tree-filter {
  width: 100%; box-sizing: border-box; padding: 8px 10px; margin-bottom: 8px;
  border: 1px solid #9aa2ad; border-radius: 8px; font: inherit; direction: rtl;
  text-align: right; color: #1f2937; outline: none;
}
.ccp-cb-tree-filter:focus { border-color: var(--ccp-cb-primary,#1f7a63); box-shadow: 0 0 0 2px rgba(31,122,99,.2); }
.ccp-cb-tree-list { display: flex; flex-direction: column; gap: 6px; max-height: 190px; overflow-y: auto; }
.ccp-cb-tree-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; text-align: right; background: #f7f8fa; border: 1px solid #e5e7eb;
  border-radius: 10px; padding: 9px 12px; font: inherit; color: #1f2937; cursor: pointer;
}
.ccp-cb-tree-item:hover { background: #eef5f2; border-color: #cfe3db; }
.ccp-cb-tree-item:focus-visible { outline: 2px solid var(--ccp-cb-primary,#1f7a63); outline-offset: 1px; }
.ccp-cb-tree-item.leaf { color: var(--ccp-cb-primary,#1f7a63); font-weight: 600; }
.ccp-cb-tree-chev { color: var(--ccp-cb-primary,#1f7a63); font-size: 16px; line-height: 1; }
.ccp-cb-tree-note { font-size: 13px; color: #4b5563; padding: 6px 2px; }
.ccp-cb-tree-note.is-error { color: #b91c1c; }

.ccp-cb-window { flex: 1; overflow-y: auto; padding: 12px; background: #f7f8fa; min-height: 90px; }
.ccp-cb-msg { display: flex; margin: 8px 0; }
.ccp-cb-msg.user { justify-content: flex-start; }
.ccp-cb-msg.bot { justify-content: flex-end; }
.ccp-cb-bubble {
  padding: 9px 13px; border-radius: 16px; max-width: 78%; line-height: 1.45;
  font-size: 14px; word-wrap: break-word; overflow-wrap: anywhere; text-align: right;
}
.ccp-cb-msg.user .ccp-cb-bubble { background: var(--ccp-cb-primary,#1f7a63); color: #fff; border-bottom-right-radius: 4px; }
.ccp-cb-msg.bot .ccp-cb-bubble { background: #e8eaed; color: #1f2937; border-bottom-left-radius: 4px; }

.ccp-cb-results { display: flex; flex-direction: column; gap: 5px; margin-top: 8px; }
.ccp-cb-result {
  display: block; width: 100%; text-align: right; background: #fff; color: var(--ccp-cb-primary,#1f7a63);
  border: 1px solid #cfe3db; border-radius: 10px; padding: 7px 11px; font: inherit;
  font-weight: 600; cursor: pointer;
}
.ccp-cb-result:hover { background: #eef5f2; }
.ccp-cb-result:focus-visible { outline: 2px solid var(--ccp-cb-primary,#1f7a63); outline-offset: 1px; }

.ccp-cb-input { display: flex; gap: 8px; padding: 10px; border-top: 1px solid #e5e7eb; background: #fff; }
.ccp-cb-input input {
  flex: 1; padding: 10px 12px; border: 1px solid #9aa2ad; border-radius: 20px; outline: none;
  font: inherit; direction: rtl; text-align: right; color: #1f2937;
}
.ccp-cb-input input:focus { border-color: var(--ccp-cb-primary,#1f7a63); box-shadow: 0 0 0 2px rgba(31,122,99,.2); }
.ccp-cb-input input::placeholder { color: #4b5563; }
.ccp-cb-send {
  padding: 10px 18px; background: var(--ccp-cb-primary,#1f7a63); color: #fff; border: none; border-radius: 20px;
  cursor: pointer; font: inherit; font-weight: 600;
}
.ccp-cb-send:hover { background: var(--ccp-cb-primary-hover,#19624f); }
.ccp-cb-send:focus-visible { outline: 2px solid #111827; outline-offset: 2px; }

@media (max-width: 480px) {
  .ccp-cb-panel { left: 12px; right: 12px; width: auto; max-width: none; bottom: 126px; max-height: 72vh; }
  .ccp-cb-launch { left: 12px; bottom: 64px; }
}

.ccp-cb-field { position: relative; flex: 1; display: flex; align-items: center; }
.ccp-cb-field > input { flex: 1; padding-inline-end: 40px; }
.ccp-cb-field--tree { display: block; margin-bottom: 8px; }
.ccp-cb-field--tree .ccp-cb-tree-filter { width: 100%; margin-bottom: 0; padding-inline-end: 40px; }

.ccp-cb-mic {
  position: absolute; top: 50%; inset-inline-end: 8px; transform: translateY(-50%);
  width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center;
  padding: 0; margin: 0; border: none; background: transparent; cursor: pointer;
  color: var(--ccp-cb-primary,#1f7a63); border-radius: 50%; line-height: 0;
}
.ccp-cb-mic:hover { background: rgba(31,122,99,.10); }
.ccp-cb-mic:focus-visible { outline: 2px solid var(--ccp-cb-primary,#1f7a63); outline-offset: 1px; }
.ccp-cb-mic svg { width: 18px; height: 18px; display: block; fill: currentColor; }
.ccp-cb-mic.is-listening { color: #b91c1c; animation: ccpCbMicPulse 1.2s ease-out infinite; }
@keyframes ccpCbMicPulse {
  0% { box-shadow: 0 0 0 0 rgba(185,28,28,.45); }
  70% { box-shadow: 0 0 0 8px rgba(185,28,28,0); }
  100% { box-shadow: 0 0 0 0 rgba(185,28,28,0); }
}
@media (prefers-reduced-motion: reduce) { .ccp-cb-mic.is-listening { animation: none; } }
.ccp-cb-mic-hint {
  position: absolute; bottom: 100%; inset-inline-end: 0; margin-bottom: 6px;
  background: #111827; color: #fff; font-size: 12px; line-height: 1.3;
  padding: 5px 9px; border-radius: 6px; max-width: 220px; z-index: 6; cursor: pointer;
  direction: rtl; text-align: right;
}
