/* ============================================================================
   Chat assistant widget — trilingual (EN / HI / MR)
   Matches the portfolio design system: mint / ink / coral, offset shadows.
   ============================================================================ */

.cb-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 1300;
  width: 62px; height: 62px; border-radius: 50%;
  background: var(--coral, #ff6b5e); color: #fff;
  border: 2px solid var(--ink, #17211b);
  box-shadow: 4px 4px 0 var(--ink, #17211b);
  display: grid; place-items: center;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.cb-fab:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink, #17211b); }
.cb-fab:active { transform: translate(1px, 1px); box-shadow: 2px 2px 0 var(--ink, #17211b); }
.cb-fab svg { width: 28px; height: 28px; }
.cb-fab .cb-dot {
  position: absolute; top: 2px; right: 2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: #23c55e; border: 2px solid #fff;
}
@media (prefers-reduced-motion: no-preference) {
  .cb-fab .cb-dot { animation: cbPulse 2.2s ease-out infinite; }
  @keyframes cbPulse {
    0% { box-shadow: 0 0 0 0 #23c55e66; }
    70% { box-shadow: 0 0 0 8px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
  }
}

.cb-panel {
  position: fixed; right: 22px; bottom: 96px; z-index: 1300;
  width: min(380px, calc(100vw - 32px));
  height: min(560px, calc(100dvh - 130px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--cream, #fffdf8);
  border: 2px solid var(--ink, #17211b);
  border-radius: 22px;
  box-shadow: 6px 6px 0 var(--ink, #17211b);
  opacity: 0; visibility: hidden;
  transform: translateY(16px) scale(0.97);
  transform-origin: bottom right;
  transition: opacity 0.3s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
              visibility 0s 0.3s;
}
.cb-panel.open {
  opacity: 1; visibility: visible; transform: none;
  transition: opacity 0.3s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.cb-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: var(--ink, #17211b); color: var(--mint, #eaf7f2);
  flex-shrink: 0;
}
.cb-head img {
  width: 40px; height: 40px; border-radius: 50%;
  border: 2px solid var(--mint, #eaf7f2); object-fit: cover; background: #fff;
}
.cb-head-txt { min-width: 0; flex: 1; }
.cb-head-name {
  font-family: "Bricolage Grotesque", "Nirmala UI", sans-serif;
  font-weight: 800; font-size: 15.5px; line-height: 1.2;
}
.cb-head-sub {
  font-family: "Space Mono", monospace; font-size: 10.5px;
  color: #8ce6ca; display: flex; align-items: center; gap: 5px;
}
.cb-head-sub::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: #23c55e;
}
.cb-langs { display: flex; gap: 4px; }
.cb-langs button {
  padding: 4px 8px; border-radius: 999px;
  border: 1.5px solid #eaf7f266; color: #eaf7f2cc;
  font-family: "Space Mono", monospace; font-size: 10px; font-weight: 700;
}
.cb-langs button.on { background: var(--coral, #ff6b5e); border-color: var(--coral, #ff6b5e); color: #fff; }
.cb-close { margin-left: 2px; color: var(--mint, #eaf7f2); display: grid; place-items: center; }
.cb-close:hover { color: var(--coral, #ff6b5e); }

.cb-body {
  flex: 1; overflow-y: auto; padding: 16px 14px;
  display: flex; flex-direction: column; gap: 10px;
  scrollbar-width: thin;
  background:
    radial-gradient(400px 200px at 100% 0%, #8ce6ca2e 0%, transparent 60%),
    var(--mint, #eaf7f2);
}
.cb-msg {
  max-width: 86%; padding: 10px 14px;
  border: 2px solid var(--ink, #17211b); border-radius: 16px;
  font-size: 13.5px; line-height: 1.55;
  white-space: pre-line; overflow-wrap: break-word;
}
.cb-msg.bot {
  align-self: flex-start;
  background: var(--cream, #fffdf8);
  border-bottom-left-radius: 4px;
  box-shadow: 2px 2px 0 #17211b40;
}
.cb-msg.user {
  align-self: flex-end;
  background: var(--coral, #ff6b5e); color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: 2px 2px 0 var(--ink, #17211b);
}
@media (prefers-reduced-motion: no-preference) {
  .cb-msg { animation: cbPop 0.35s cubic-bezier(0.22, 1, 0.36, 1); }
  @keyframes cbPop { from { opacity: 0; translate: 0 10px; } }
}
.cb-msg b { font-weight: 700; }
.cb-msg a { color: inherit; font-weight: 700; text-decoration-thickness: 2px; }
.cb-msg.bot a { color: var(--coral, #e8574a); }

.cb-typing {
  align-self: flex-start; display: flex; gap: 4px;
  padding: 12px 16px;
  border: 2px solid var(--ink, #17211b); border-radius: 16px;
  border-bottom-left-radius: 4px; background: var(--cream, #fffdf8);
}
.cb-typing i {
  width: 7px; height: 7px; border-radius: 50%; background: #5d6860;
  animation: cbBlink 1.1s infinite;
}
.cb-typing i:nth-child(2) { animation-delay: 0.18s; }
.cb-typing i:nth-child(3) { animation-delay: 0.36s; }
@keyframes cbBlink { 0%, 60%, 100% { opacity: 0.25; } 30% { opacity: 1; translate: 0 -3px; } }

.cb-chips {
  display: flex; flex-wrap: wrap; gap: 7px;
  align-self: flex-start; max-width: 95%;
}
.cb-chips button {
  padding: 7px 13px;
  border: 2px solid var(--ink, #17211b); border-radius: 999px;
  background: #fff; font-size: 12px; font-weight: 700;
  font-family: "Plus Jakarta Sans", "Nirmala UI", sans-serif;
  box-shadow: 2px 2px 0 #17211b33;
  transition: background 0.2s, color 0.2s, transform 0.2s;
}
.cb-chips button:hover {
  background: var(--ink, #17211b); color: var(--mint, #eaf7f2);
  transform: translateY(-2px);
}

.cb-foot {
  flex-shrink: 0; display: flex; gap: 8px; align-items: center;
  padding: 12px; border-top: 2px solid var(--ink, #17211b);
  background: var(--cream, #fffdf8);
}
.cb-input {
  flex: 1; min-width: 0; padding: 11px 14px;
  border: 2px solid var(--ink, #17211b); border-radius: 999px;
  background: #fff; color: var(--ink, #17211b);
  font: inherit; font-size: 13.5px;
}
.cb-input:focus { outline: none; box-shadow: 2px 2px 0 var(--coral, #ff6b5e); }
.cb-send {
  width: 42px; height: 42px; flex-shrink: 0; border-radius: 50%;
  background: var(--coral, #ff6b5e); color: #fff;
  border: 2px solid var(--ink, #17211b);
  box-shadow: 2px 2px 0 var(--ink, #17211b);
  display: grid; place-items: center;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s;
}
.cb-send:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink, #17211b); }
.cb-send:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--ink, #17211b); }

@media (max-width: 480px) {
  .cb-panel {
    right: 16px; left: 16px; width: auto;
    bottom: 90px; height: min(540px, calc(100dvh - 110px));
  }
  .cb-fab { right: 16px; bottom: 16px; }
}
