#cdi-ai-chat, #cdi-ai-chat * { box-sizing: border-box; }
.cdi-ai-chat { position: fixed; z-index: 99990; right: 10px; bottom: 122px; font-family: Arial, sans-serif; }
.cdi-ai-toggle { width: 70px; height: 70px; border: 0; border-radius: 50%; background: #2363EB; color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 22px rgba(0,0,0,.25); transition: transform .18s ease, box-shadow .18s ease; position: relative; isolation: isolate; overflow: visible; }
.cdi-ai-toggle::before, .cdi-ai-toggle::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(35,99,235,.42); pointer-events: none; z-index: -1; animation: cdi-ai-pulse 2.2s ease-out infinite; }
.cdi-ai-toggle::after { animation-delay: 1.1s; }
@keyframes cdi-ai-pulse { 0% { transform: scale(1); opacity: .72; } 75%, 100% { transform: scale(1.38); opacity: 0; } }
.cdi-ai-toggle:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(0,0,0,.3); }
.cdi-ai-toggle svg { width: 32px; height: 32px; fill: currentColor; }
.cdi-ai-panel { position: absolute; right: 0; bottom: 80px; width: min(370px, calc(100vw - 28px)); height: min(520px, calc(100vh - 150px)); min-height: 390px; overflow: hidden; background: #fff; color: #202124; border: 1px solid rgba(0,0,0,.12); border-radius: 14px; box-shadow: 0 14px 46px rgba(0,0,0,.28); display: flex; flex-direction: column; }
.cdi-ai-panel[hidden] { display: none !important; }
.cdi-ai-header { height: 68px; padding: 12px 14px; background: #25262c; color: #fff; display: flex; align-items: center; justify-content: space-between; flex: 0 0 68px; }
.cdi-ai-header strong { display: block; font-size: 18px; line-height: 1.2; }
.cdi-ai-header span { display: block; margin-top: 4px; color: #cfd2d8; font-size: 13px; }
.cdi-ai-close { border: 0; background: transparent; color: #fff; cursor: pointer; font-size: 28px; line-height: 1; padding: 6px 8px; }
.cdi-ai-messages { flex: 1 1 auto; min-height: 0; padding: 14px; overflow-y: auto; background: #f5f6f7; }
.cdi-ai-msg { max-width: 88%; padding: 10px 12px; margin: 0 0 10px; border-radius: 12px; font-size: 15px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.cdi-ai-bot { margin-right: auto; background: #fff; border: 1px solid #e1e3e6; }
.cdi-ai-greeting { max-width: 88%; margin: 0 0 10px 0 !important; padding: 10px 24px 10px 0 !important; background: transparent; border: 0; border-radius: 0; text-align: left; text-indent: 0 !important; font-weight: 400; line-height: 1.45; white-space: normal; }
.cdi-ai-user { margin-left: auto; background: #25262c; color: #fff; }
.cdi-ai-loading { font-size: 22px; letter-spacing: 3px; }
.cdi-ai-chips { padding: 8px 10px 5px; background: #fff; display: flex; gap: 6px; overflow-x: auto; flex: 0 0 auto; }
.cdi-ai-chips button { white-space: nowrap; border: 1px solid #cfd3d8; background: #fff; border-radius: 999px; padding: 5px 10px; font-size: 13px; cursor: pointer; }
.cdi-ai-chips button:hover { border-color: #16E2AF; color: #0a7f64; }
.cdi-ai-form { padding: 7px 10px 5px; display: flex; gap: 8px; align-items: flex-end; background: #fff; flex: 0 0 auto; }
.cdi-ai-form textarea { flex: 1; resize: none; min-height: 38px; max-height: 96px; padding: 9px 10px; border: 1px solid #cfd3d8; border-radius: 9px; font: inherit; font-size: 15px; line-height: 1.35; outline: none; }
.cdi-ai-form textarea:focus { border-color: #16E2AF; box-shadow: 0 0 0 2px rgba(22,226,175,.15); }
.cdi-ai-form button { width: 39px; height: 39px; border: 0; border-radius: 9px; background: #16E2AF; color: #111; font-size: 18px; cursor: pointer; }
.cdi-ai-form button:disabled { opacity: .45; cursor: default; }
.cdi-ai-note { padding: 0 10px 14px; color: #73777d; background: #fff; font-size: 11px; line-height: 1.35; text-align: center; flex: 0 0 auto; }
@media (max-width: 600px) {
  .cdi-ai-chat { right: 4px; bottom: 114px; }
  .cdi-ai-toggle { width: 70px; height: 70px; }
  .cdi-ai-panel { right: 0; bottom: 76px; width: calc(100vw - 28px); height: min(560px, calc(100vh - 120px)); }
}
.cdi-ai-header-actions { display: flex; align-items: center; gap: 2px; }
.cdi-ai-clear { border: 0; background: transparent; color: #fff; cursor: pointer; font-size: 23px; line-height: 1; padding: 6px 7px; opacity: .9; }
.cdi-ai-clear:hover { opacity: 1; }
.cdi-ai-rating { display: flex; gap: 4px; margin: -5px 0 9px 2px; }
.cdi-ai-rating button { border: 0; background: transparent; cursor: pointer; padding: 2px 4px; font-size: 14px; line-height: 1; opacity: .48; filter: grayscale(1); transition: opacity .15s ease, transform .15s ease, filter .15s ease; }
.cdi-ai-rating button:hover { opacity: .9; transform: translateY(-1px); filter: grayscale(0); }
.cdi-ai-rating button.is-active { opacity: 1; filter: grayscale(0); }

@media (prefers-reduced-motion: reduce) {
  .cdi-ai-toggle::before, .cdi-ai-toggle::after { animation: none; }
}
