tapthebell-chat,
caniask-chat {
  --ttb-accent: #6f63ff;
  --ttb-accent-rgb: 111, 99, 255;
  --cia-accent: var(--ttb-accent);
  --cia-accent-rgb: var(--ttb-accent-rgb);
  --cia-ink: #15151a;
  --cia-muted: #6c6c74;
  --cia-surface: rgba(255,255,255,.76);
  --cia-radius: 30px;
  position: relative;
  z-index: 2147483000;
  color: var(--cia-ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

tapthebell-chat *, tapthebell-chat *::before, tapthebell-chat *::after,
caniask-chat *, caniask-chat *::before, caniask-chat *::after { box-sizing: border-box; }
tapthebell-chat button, tapthebell-chat textarea,
caniask-chat button, caniask-chat textarea { font: inherit; }

.cia-shell { position: fixed; right: max(20px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom)); z-index: 2147483000; }
.cia-launcher {
  position: relative; display: grid; place-items: center; width: 68px; height: 68px; padding: 0;
  overflow: hidden; border: 0; border-radius: 24px;
  background: linear-gradient(145deg, rgba(255,255,255,.22), rgba(255,255,255,.085) 48%, rgba(255,255,255,.045));
  color: rgba(22,22,27,.82); cursor: pointer; isolation: isolate;
  box-shadow: 0 16px 40px rgba(19,18,38,.16), inset 0 1px 0 rgba(255,255,255,.42);
  backdrop-filter: blur(22px) saturate(165%) contrast(104%); -webkit-backdrop-filter: blur(22px) saturate(165%) contrast(104%);
  transition: transform .24s cubic-bezier(.2,.8,.2,1), box-shadow .24s ease, background .24s ease;
}
.cia-launcher::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background: linear-gradient(122deg, rgba(255,255,255,.2) 0%, rgba(255,255,255,.07) 38%, transparent 64%);
}
.cia-launcher::after {
  content: ""; position: absolute; inset: 1px; z-index: -1; border-radius: 23px;
  background: rgba(255,255,255,.055);
  box-shadow: inset 0 0 24px rgba(255,255,255,.07);
}
.cia-launcher:hover { transform: translateY(-3px) scale(1.025); background: linear-gradient(145deg, rgba(255,255,255,.28), rgba(255,255,255,.1) 48%, rgba(255,255,255,.055)); box-shadow: 0 22px 50px rgba(19,18,38,.2), inset 0 1px 0 rgba(255,255,255,.5); }
.cia-launcher:focus-visible { outline: 3px solid rgba(31,31,36,.22); outline-offset: 4px; }
.cia-launcher svg { width: 30px; height: 30px; filter: drop-shadow(0 1px 1px rgba(255,255,255,.64)) drop-shadow(0 2px 5px rgba(0,0,0,.14)); transition: transform .2s ease; }
.cia-shell[data-open="true"] .cia-launcher svg { transform: rotate(-5deg) scale(.92); }

.cia-panel {
  position: absolute; right: 0; bottom: 86px; display: grid; grid-template-rows: auto minmax(250px,1fr) auto;
  width: min(430px, calc(100vw - 24px)); height: min(620px, calc(100vh - 126px)); overflow: hidden;
  border: 0; border-radius: var(--cia-radius);
  background: rgba(247,247,249,.8);
  box-shadow: 0 28px 72px rgba(21,20,36,.22), 0 2px 10px rgba(21,20,36,.06);
  backdrop-filter: blur(36px) saturate(155%); -webkit-backdrop-filter: blur(36px) saturate(155%);
  transform-origin: 90% 100%; animation: cia-open .28s cubic-bezier(.2,.85,.2,1);
}
.cia-panel[hidden] { display: none; }
.cia-head { position: relative; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 16px; padding: 24px 24px 16px; border: 0; }
.cia-head-copy { display: grid; gap: 4px; min-width: 0; }
.cia-head-copy strong { overflow: hidden; font-size: 18px; letter-spacing: -.025em; text-overflow: ellipsis; white-space: nowrap; }
.cia-head-copy span { color: var(--cia-muted); font-size: 13px; line-height: 1.25; }
.cia-close { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #707077; cursor: pointer; font-size: 20px; transition: background .15s ease, color .15s ease; }
.cia-close:hover { background: rgba(118,118,128,.1); color: #35353a; }
.cia-close:focus-visible { outline: 2px solid var(--cia-accent); outline-offset: 2px; }

.cia-thread { display: flex; flex-direction: column; gap: 14px; overflow: auto; padding: 16px 24px 20px; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(0,0,0,.15) transparent; }
.cia-time { align-self: center; margin: 2px 0 5px; color: #8f8f96; font-size: 11px; font-weight: 600; letter-spacing: .035em; text-transform: uppercase; }
.cia-message { display: grid; max-width: 86%; animation: cia-message .2s ease both; }
.cia-message[data-sender="visitor"] { align-self: flex-end; }
.cia-message[data-sender="operator"], .cia-message[data-sender="system"] { align-self: flex-start; }
.cia-bubble { padding: 14px 16px; border: 0; border-radius: 20px 20px 20px 8px; background: rgba(255,255,255,.62); color: #29292f; font-size: 15px; line-height: 1.48; white-space: pre-wrap; overflow-wrap: anywhere; }
.cia-message[data-sender="visitor"] .cia-bubble { border-radius: 20px 20px 8px 20px; background: var(--cia-accent); color: #fff; box-shadow: 0 6px 16px rgba(var(--cia-accent-rgb),.14); }
.cia-typing { align-self: flex-start; display: flex; gap: 5px; padding: 14px 16px; border-radius: 20px 20px 20px 8px; background: rgba(255,255,255,.62); }
.cia-typing i { width: 5px; height: 5px; border-radius: 50%; background: #9e9ea5; animation: cia-dot 1.2s infinite ease-in-out; }
.cia-typing i:nth-child(2) { animation-delay: .14s; }.cia-typing i:nth-child(3) { animation-delay: .28s; }
.cia-error { margin: 0 20px; padding: 11px 13px; border-radius: 13px; background: #fff1f1; color: #a42828; font-size: 12px; line-height: 1.4; }
.cia-error[hidden] { display: none; }

.cia-compose { padding: 12px 18px 18px; border: 0; background: transparent; }
.cia-compose form { display: grid; grid-template-columns: 1fr 44px; align-items: end; gap: 9px; padding: 8px 8px 8px 15px; border: 0; border-radius: 22px; background: rgba(255,255,255,.58); box-shadow: 0 2px 12px rgba(20,20,35,.035); }
.cia-compose textarea { width: 100%; max-height: 112px; min-height: 39px; padding: 8px 0 4px; resize: none; border: 0; outline: 0; background: transparent; color: var(--cia-ink); font-size: 15px; line-height: 1.4; }
.cia-compose textarea::placeholder { color: #9999a0; }
.cia-send { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 16px; background: var(--cia-accent); color: #fff; cursor: pointer; box-shadow: 0 6px 15px rgba(var(--cia-accent-rgb),.17); transition: transform .15s ease, opacity .15s ease; }
.cia-send:hover { transform: translateY(-1px); }.cia-send:disabled { opacity: .45; cursor: wait; transform: none; }
.cia-send svg { width: 19px; height: 19px; }
.cia-foot { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 11px; color: #8f8f96; font-size: 10px; }
.cia-foot a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

@keyframes cia-open { from { opacity: 0; transform: translateY(12px) scale(.94); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes cia-message { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes cia-dot { 0%,60%,100% { transform: translateY(0); opacity:.45 } 30% { transform: translateY(-3px); opacity:1 } }

@media (max-width: 520px) {
  .cia-shell { right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); }
  .cia-launcher { width: 64px; height: 64px; border-radius: 22px; }
  .cia-launcher::after { border-radius: 21px; }
  .cia-panel { position: fixed; inset: 8px 8px max(86px, calc(76px + env(safe-area-inset-bottom))) 8px; width: auto; height: auto; border-radius: 27px; }
}

@media (prefers-reduced-motion: reduce) {
  .cia-typing i { animation: none; }
  .cia-panel, .cia-message { animation-duration: .01ms; }
  .cia-launcher, .cia-send { transition: none; }
}
