/* Rang badalne ke liye sirf ye 3 variables badlein */
#cb-root, #cb-root * { box-sizing: border-box; }
#cb-root {
  --cb-accent: #d4a62a;      /* golden: button, header, user messages */
  --cb-accent-text: #241a00; /* gold par gehra text, taake saaf parha jaye */
  --cb-bg: #ffffff;
  --cb-ink: #1d2327;
  --cb-soft: #f1ece0;
  position: fixed; right: 20px; bottom: 20px; z-index: 99999;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Naskh Arabic", "Noto Nastaliq Urdu", sans-serif;
  font-size: 15px; color: var(--cb-ink);
}
#cb-root[hidden] { display: none; }

.cb-fab {
  width: 58px; height: 58px; border: 0; border-radius: 50%; cursor: pointer;
  background: var(--cb-accent); color: var(--cb-accent-text);
  box-shadow: 0 6px 20px rgba(60,40,0,.3); display: grid; place-items: center;
}
.cb-fab svg { width: 28px; height: 28px; }
.cb-fab:focus-visible, .cb-send:focus-visible, .cb-close:focus-visible { outline: 3px solid #241a00; outline-offset: 2px; }

.cb-panel {
  position: absolute; right: 0; bottom: 72px;
  width: 360px; max-width: calc(100vw - 40px); height: 520px; max-height: calc(100vh - 110px);
  display: none; flex-direction: column; overflow: hidden;
  background: var(--cb-bg); border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,.28);
}
#cb-root.cb-open .cb-panel { display: flex; animation: cb-pop .18s ease-out; }
@keyframes cb-pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

.cb-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; background: var(--cb-accent); color: var(--cb-accent-text);
}
.cb-brand { display: flex; align-items: center; gap: 10px; }
.cb-logo { width: 36px; height: 36px; border-radius: 50%; flex: none; }
.cb-title { font-weight: 600; font-size: 16px; }
.cb-close { background: none; border: 0; color: inherit; font-size: 24px; line-height: 1; cursor: pointer; padding: 2px 6px; }

.cb-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: #fbf9f3; }
.cb-msg { max-width: 85%; padding: 10px 13px; border-radius: 14px; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.cb-bot  { align-self: flex-start; background: var(--cb-soft); border-bottom-left-radius: 4px; }
.cb-user { align-self: flex-end; background: var(--cb-accent); color: var(--cb-accent-text); border-bottom-right-radius: 4px; }
.cb-err  { align-self: flex-start; background: #fdeceb; color: #8a1f17; }

.cb-typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.cb-typing i { width: 7px; height: 7px; border-radius: 50%; background: #8a7a55; animation: cb-b 1s infinite; }
.cb-typing i:nth-child(2) { animation-delay: .15s; } .cb-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes cb-b { 0%,60%,100% { opacity: .3; } 30% { opacity: 1; } }

.cb-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid #e3e8e6; background: var(--cb-bg); }
.cb-input { flex: 1; border: 1px solid #cfd6d3; border-radius: 10px; padding: 10px 12px; font: inherit; color: inherit; }
.cb-input:focus { outline: 2px solid var(--cb-accent); border-color: transparent; }
.cb-send { border: 0; border-radius: 10px; padding: 0 16px; background: var(--cb-accent); color: var(--cb-accent-text); font: inherit; font-weight: 600; cursor: pointer; }
.cb-send:disabled { opacity: .5; cursor: default; }

@media (max-width: 480px) {
  #cb-root { right: 12px; bottom: 12px; }
  .cb-panel { width: calc(100vw - 24px); height: calc(100vh - 100px); }
}
@media (prefers-reduced-motion: reduce) { .cb-panel, .cb-typing i { animation: none !important; } }

.cb-msg a { color: inherit; text-decoration: underline; text-underline-offset: 2px; word-break: break-all; font-weight: 500; }

/* Chat history and answer feedback controls */
.cb-head-actions{display:flex;align-items:center;gap:8px}.cb-clear{border:0;background:transparent;color:inherit;opacity:.85;cursor:pointer;font:inherit;font-size:12px}.cb-feedback{display:flex;gap:6px;margin-top:8px}.cb-feedback button{border:1px solid #dbe3ef;background:#fff;border-radius:7px;padding:3px 9px;cursor:pointer}.cb-feedback button:hover{background:#eff6ff}
