/* Cashworx ATM assistant widget */
.cw-chat-launch {
  position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 9000;
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .8rem 1.1rem; border: 0; border-radius: 999px; cursor: pointer;
  font: 600 .95rem/1 Archivo, system-ui, sans-serif; color: #fff;
  background: var(--green, #1d7a46); box-shadow: 0 8px 24px rgba(0,0,0,.22);
  transition: transform .15s ease, box-shadow .15s ease;
}
.cw-chat-launch:hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(0,0,0,.26); }
.cw-chat-launch svg { width: 20px; height: 20px; }
.cw-chat-launch[hidden] { display: none; }

.cw-chat {
  position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 9001;
  width: min(380px, calc(100vw - 2.5rem)); height: min(560px, calc(100vh - 2.5rem));
  display: flex; flex-direction: column; overflow: hidden;
  background: #fff; color: var(--ink, #111); border-radius: 14px;
  border: 1px solid var(--rule, #e3e3e3); box-shadow: 0 18px 48px rgba(0,0,0,.28);
  font-family: Archivo, system-ui, sans-serif;
}
.cw-chat[hidden] { display: none; }

.cw-chat-head {
  display: flex; align-items: center; gap: .7rem; padding: .85rem 1rem;
  background: var(--ink, #111); color: #fff;
}
.cw-chat-head .cw-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green, #2fbf71); box-shadow: 0 0 0 3px rgba(47,191,113,.25); }
.cw-chat-head strong { font-size: .95rem; }
.cw-chat-head small { display: block; font-size: .75rem; opacity: .75; font-weight: 400; }
.cw-chat-head button {
  margin-left: auto; background: none; border: 0; color: #fff; cursor: pointer;
  font-size: 1.4rem; line-height: 1; padding: .2rem .4rem; opacity: .8;
}
.cw-chat-head button:hover { opacity: 1; }

.cw-chat-log { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .6rem; background: #f7f8f7; }
.cw-msg { max-width: 85%; padding: .6rem .8rem; border-radius: 12px; font-size: .92rem; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; }
.cw-msg.bot { align-self: flex-start; background: #fff; border: 1px solid var(--rule, #e3e3e3); border-bottom-left-radius: 4px; }
.cw-msg.user { align-self: flex-end; background: var(--green, #1d7a46); color: #fff; border-bottom-right-radius: 4px; }
.cw-msg.error { align-self: stretch; max-width: none; background: #fff4f2; border: 1px solid #f1c3bb; color: #8a2a1a; font-size: .85rem; }
.cw-msg a { color: inherit; text-decoration: underline; }
.cw-msg.bot a { color: var(--green-deep, #15603a); }
.cw-msg ul { margin: .3rem 0 0; padding-left: 1.1rem; }
.cw-msg li { margin: .15rem 0; }

.cw-typing { align-self: flex-start; display: inline-flex; gap: 4px; padding: .7rem .9rem; background: #fff; border: 1px solid var(--rule, #e3e3e3); border-radius: 12px; border-bottom-left-radius: 4px; }
.cw-typing span { width: 6px; height: 6px; border-radius: 50%; background: #999; animation: cw-bounce 1.2s infinite; }
.cw-typing span:nth-child(2) { animation-delay: .15s; }
.cw-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes cw-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

.cw-chips { display: flex; flex-wrap: wrap; gap: .4rem; padding: 0 1rem .6rem; background: #f7f8f7; }
.cw-chips button {
  font: 500 .8rem/1.2 inherit; padding: .45rem .7rem; border-radius: 999px; cursor: pointer;
  background: #fff; color: var(--ink, #111); border: 1px solid var(--rule, #d9d9d9);
}
.cw-chips button:hover { border-color: var(--green, #1d7a46); color: var(--green-deep, #15603a); }
.cw-chips[hidden] { display: none; }

.cw-chat-form { display: flex; gap: .5rem; padding: .7rem; border-top: 1px solid var(--rule, #e3e3e3); background: #fff; }
.cw-chat-form textarea {
  flex: 1; resize: none; min-height: 42px; max-height: 110px; padding: .6rem .75rem;
  font: 400 .92rem/1.35 inherit; color: var(--ink, #111);
  border: 1px solid var(--rule, #d9d9d9); border-radius: 10px; outline: none;
}
.cw-chat-form textarea:focus { border-color: var(--green, #1d7a46); box-shadow: 0 0 0 3px rgba(29,122,70,.15); }
.cw-chat-form button {
  width: 44px; border: 0; border-radius: 10px; cursor: pointer; color: #fff;
  background: var(--green, #1d7a46); display: grid; place-items: center;
}
.cw-chat-form button:disabled { opacity: .5; cursor: default; }
.cw-chat-form button svg { width: 18px; height: 18px; }
.cw-chat-foot { padding: .35rem .9rem .6rem; font-size: .7rem; color: #777; background: #fff; text-align: center; }
.cw-chat-foot a { color: inherit; }

@media (max-width: 480px) {
  .cw-chat { right: 0; bottom: 0; width: 100vw; height: 100dvh; border-radius: 0; }
  .cw-chat-launch { right: 1rem; bottom: 1rem; }
}