/* Live chat bubble (assets/js/cit-chat.js, includes/cit-chat-widget.php). */
.cit-chat { --cc-purple: var(--cit-purple, #6550ff); --cc-ink: var(--cit-ink, #14123a); --cc-muted: var(--cit-muted, #5d5b7a);
  --cc-line: var(--cit-line, #e6e4f2); --cc-bg: #fff; --cc-soft: var(--cit-pale-2, #f5f4fb);
  position: fixed; right: 22px; bottom: 22px; z-index: 1035; font-family: var(--cit-font, inherit); color: var(--cc-ink); }
html.dark .cit-chat { --cc-bg: #17152e; --cc-soft: #221f3d; --cc-line: #34305a; --cc-ink: #ecebff; --cc-muted: #a9a6cc; }
.cit-chat[hidden] { display: none; }
body.cit-has-chat .cit-float-cta { bottom: 94px; }

/* The launcher: a "Want to chat?" bar that shrinks to a round close button while the panel is open. */
.cit-chat__launch { display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 10px 0 8px; border: 0; border-radius: 18px;
  background: linear-gradient(135deg, var(--cc-purple), #4d37e6); color: #fff; cursor: pointer; text-align: left; font: inherit;
  box-shadow: 0 12px 30px rgba(55, 40, 180, .35); position: relative; transition: transform .15s ease, box-shadow .15s ease, border-radius .15s ease; }
.cit-chat__launch:hover { transform: translateY(-2px); box-shadow: 0 16px 36px rgba(55, 40, 180, .42); }
.cit-chat__launch:focus-visible { outline: 3px solid #fff; box-shadow: 0 0 0 6px var(--cc-purple); }
.cit-chat__launch-ico { position: relative; width: 44px; height: 44px; border-radius: 13px; background: rgba(255, 255, 255, .16); display: grid; place-items: center; flex: none; }
.cit-chat__launch-ico svg { width: 23px; height: 23px; }
.cit-chat__live { position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px; border-radius: 50%; background: #b9b4d9; border: 2px solid #5a44f0; }
.cit-chat__live.is-on { background: #3ddc84; }
.cit-chat__live.is-on::after { content: ""; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid #3ddc84; animation: cit-chat-ping 2s ease-out infinite; }
@keyframes cit-chat-ping { 0% { transform: scale(1); opacity: .8; } 80%, 100% { transform: scale(2.2); opacity: 0; } }
.cit-chat__launch-txt { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; padding-right: 4px; }
/* Explicit colours: page styles for strong/small must not leak into the bar. */
.cit-chat__launch-txt strong { font-size: 15.5px; font-weight: 700; white-space: nowrap; color: #fff; }
.cit-chat__launch-txt small { font-size: 12.5px; white-space: nowrap; color: rgba(255, 255, 255, .86); }
.cit-chat__launch-go { width: 32px; height: 32px; border-radius: 10px; background: #fff; color: var(--cc-purple); display: grid; place-items: center; flex: none; transition: transform .15s ease; }
.cit-chat__launch:hover .cit-chat__launch-go { transform: translateX(3px); }
.cit-chat__launch-go svg { width: 18px; height: 18px; }
.cit-chat__launch-x { display: none; }
.cit-chat__launch-x svg { width: 24px; height: 24px; }
.cit-chat.is-open .cit-chat__launch { width: 60px; padding: 0; justify-content: center; border-radius: 50%; }
.cit-chat.is-open .cit-chat__launch > :not(.cit-chat__launch-x):not(.cit-chat__dot) { display: none; }
.cit-chat.is-open .cit-chat__launch-x { display: grid; place-items: center; }

/* Handwritten note with an arrow pointing at the bar (Caveat, like the notes on caminho.dev). */
.cit-chat__hand { position: absolute; right: calc(100% + 6px); bottom: 26px; margin: 0; display: flex; align-items: flex-end; gap: 4px; pointer-events: none;
  font-family: var(--cit-hand, "Caveat", cursive); font-weight: 700; font-size: 25px; line-height: 1; color: var(--cc-purple); white-space: nowrap;
  transform: rotate(-3deg); transform-origin: right bottom; text-shadow: 0 0 6px #fff, 0 0 12px #fff; }
html.dark .cit-chat__hand { color: #b7adff; text-shadow: 0 0 8px rgba(10, 8, 30, .9); }
/* Over a photo or a dark section (worked out in cit-chat.js as the page scrolls). */
.cit-chat__hand.is-on-dark { color: #fff; text-shadow: 0 1px 2px rgba(8, 6, 30, .85), 0 0 10px rgba(8, 6, 30, .7), 0 0 18px rgba(8, 6, 30, .5); }
.cit-chat__hand.is-on-light { color: var(--cc-purple); text-shadow: 0 0 6px #fff, 0 0 12px #fff; }
.cit-chat__hand { transition: color .25s ease, text-shadow .25s ease; }
.cit-chat__hand[hidden] { display: none; }
.cit-chat__hand svg { width: 46px; height: 30px; margin-bottom: -14px; flex: none; }
.cit-chat__hand-t { display: inline-block; clip-path: inset(-.5em 100% -.5em -.5em); }
.cit-chat__hand path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.cit-chat__hand.is-in .cit-chat__hand-t { animation: cit-chat-write 1.5s steps(26, end) .4s forwards; }
.cit-chat__hand.is-in path { animation: cit-chat-draw .7s ease-out 1.9s forwards; }
.cit-chat__hand.is-static .cit-chat__hand-t { animation: none; clip-path: none; }
.cit-chat__hand.is-static path { animation: none; stroke-dashoffset: 0; }
@keyframes cit-chat-write { to { clip-path: inset(-.5em -.5em -.5em -.5em); } }
@keyframes cit-chat-draw { to { stroke-dashoffset: 0; } }
.cit-chat__dot { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #e5484d;
  color: #fff; font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; border: 2px solid #fff; }
.cit-chat__dot[hidden] { display: none; }

.cit-chat__panel { position: absolute; right: 0; bottom: 76px; width: 370px; max-width: calc(100vw - 24px); height: 560px; max-height: calc(100vh - 120px);
  background: var(--cc-bg); border: 1px solid var(--cc-line); border-radius: 18px; box-shadow: 0 24px 60px rgba(20, 18, 58, .22);
  display: flex; flex-direction: column; overflow: hidden; }
.cit-chat__panel[hidden] { display: none; }
.cit-chat__head { background: var(--cc-purple); color: #fff; padding: 14px 16px; display: flex; gap: 10px; align-items: flex-start; }
.cit-chat__head-main { flex: 1; min-width: 0; }
.cit-chat__title { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.3; }
.cit-chat__status { margin: 2px 0 0; font-size: 12.5px; opacity: .92; display: flex; align-items: center; gap: 6px; line-height: 1.35; }
.cit-chat__status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #b9b4d9; flex: none; }
.cit-chat__status.is-on::before { background: #3ddc84; }
.cit-chat__icon-btn { background: transparent; border: 0; color: #fff; width: 32px; height: 32px; border-radius: 8px; cursor: pointer; display: grid; place-items: center; flex: none; }
.cit-chat__icon-btn:hover, .cit-chat__icon-btn:focus-visible { background: rgba(255, 255, 255, .18); outline: none; }
.cit-chat__icon-btn svg { width: 18px; height: 18px; }
.cit-chat__end { background: rgba(255, 255, 255, .16); border: 0; color: #fff; font-size: 12px; font-weight: 600; padding: 6px 10px; border-radius: 8px; cursor: pointer; flex: none; }
.cit-chat__end:hover, .cit-chat__end:focus-visible { background: rgba(255, 255, 255, .28); outline: none; }
.cit-chat__end[hidden] { display: none; }

.cit-chat__log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--cc-soft); }
.cit-chat__msg { max-width: 84%; display: flex; flex-direction: column; gap: 3px; }
.cit-chat__msg--me { align-self: flex-end; align-items: flex-end; }
.cit-chat__who { font-size: 11.5px; color: var(--cc-muted); font-weight: 600; padding: 0 4px; }
.cit-chat__bubble { padding: 9px 13px; border-radius: 14px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere;
  background: var(--cc-bg); border: 1px solid var(--cc-line); }
.cit-chat__msg--me .cit-chat__bubble { background: var(--cc-purple); color: #fff; border-color: transparent; border-bottom-right-radius: 4px; }
.cit-chat__msg--them .cit-chat__bubble { border-bottom-left-radius: 4px; }
.cit-chat__time { font-size: 11px; color: var(--cc-muted); padding: 0 4px; }
.cit-chat__note { align-self: center; text-align: center; font-size: 12.5px; color: var(--cc-muted); max-width: 90%; }
.cit-chat__typing { align-self: flex-start; display: flex; gap: 4px; padding: 12px 14px; background: var(--cc-bg); border: 1px solid var(--cc-line); border-radius: 14px; }
.cit-chat__typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--cc-muted); animation: cit-chat-dot 1.2s infinite ease-in-out; }
.cit-chat__typing span:nth-child(2) { animation-delay: .15s; } .cit-chat__typing span:nth-child(3) { animation-delay: .3s; }
@keyframes cit-chat-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .cit-chat__typing span, .cit-chat__live.is-on::after { animation: none; } .cit-chat__launch, .cit-chat__launch-go { transition: none; }
  .cit-chat__hand .cit-chat__hand-t, .cit-chat__hand path { animation: none !important; clip-path: none; stroke-dashoffset: 0; } }

.cit-chat__form { border-top: 1px solid var(--cc-line); padding: 12px; display: flex; flex-direction: column; gap: 8px; background: var(--cc-bg); }
.cit-chat__fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cit-chat__fields[hidden] { display: none; }
.cit-chat input, .cit-chat textarea { width: 100%; border: 1px solid var(--cc-line); border-radius: 10px; padding: 9px 11px; font: inherit; font-size: 14px;
  color: var(--cc-ink); background: var(--cc-bg); }
.cit-chat input:focus, .cit-chat textarea:focus { outline: 2px solid var(--cc-purple); outline-offset: 0; border-color: transparent; }
.cit-chat textarea { resize: none; min-height: 42px; max-height: 120px; }
.cit-chat__row { display: flex; gap: 8px; align-items: flex-end; }
.cit-chat__send { flex: none; height: 42px; padding: 0 16px; border: 0; border-radius: 10px; background: var(--cc-purple); color: #fff; font-weight: 600; font-size: 14px; cursor: pointer; }
.cit-chat__send:disabled { opacity: .55; cursor: default; }
.cit-chat__fine { margin: 0; font-size: 11.5px; color: var(--cc-muted); }
.cit-chat__fine a { color: inherit; }
.cit-chat__err { margin: 0; font-size: 12.5px; color: #c2262e; }
.cit-chat__err[hidden] { display: none; }
.cit-chat__again { margin: 4px auto 0; background: var(--cc-bg); color: var(--cc-purple); border: 1px solid var(--cc-purple); border-radius: 10px; padding: 8px 14px; font-weight: 600; cursor: pointer; }
.cit-chat__hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.cit-chat__invite { position: absolute; right: 0; bottom: 76px; width: 300px; max-width: calc(100vw - 24px); background: var(--cc-bg); border: 1px solid var(--cc-line);
  border-radius: 16px; box-shadow: 0 18px 44px rgba(20, 18, 58, .2); padding: 14px 16px; }
.cit-chat__invite[hidden] { display: none; }
.cit-chat__invite-who { margin: 0 0 4px; font-size: 12.5px; font-weight: 700; color: var(--cc-purple); }
.cit-chat__invite-text { margin: 0 0 12px; font-size: 14.5px; line-height: 1.45; white-space: pre-wrap; }
.cit-chat__invite-acts { display: flex; gap: 8px; }
.cit-chat__invite-acts button { border-radius: 10px; padding: 8px 14px; font-weight: 600; font-size: 13.5px; cursor: pointer; border: 1px solid var(--cc-line); background: var(--cc-bg); color: var(--cc-ink); }
.cit-chat__invite-acts .is-primary { background: var(--cc-purple); color: #fff; border-color: transparent; }

@media (max-width: 520px) {
  .cit-chat { right: 12px; bottom: 12px; }
  .cit-chat__panel { position: fixed; inset: 0; width: auto; max-width: none; height: auto; max-height: none; border-radius: 0; border: 0; }
  .cit-chat.is-open .cit-chat__launch { display: none; }
  .cit-chat__fields { grid-template-columns: 1fr; }
  .cit-chat__launch { height: 54px; gap: 10px; }
  .cit-chat__launch-ico { width: 38px; height: 38px; }
  .cit-chat__launch-txt small, .cit-chat__launch-go { display: none; }
  .cit-chat__hand { display: none !important; }
  body.cit-has-chat .cit-float-cta { bottom: 84px; }
}

/* "Jack is typing…" */
.cit-chat__typing--staff { align-items: center; }
.cit-chat__typing em { font-style: normal; font-size: 12px; color: var(--cc-muted); margin-left: 6px; }

/* End-chat confirmation: a card over the chat window, not a browser pop-up. */
.cit-chat__confirm { position: absolute; inset: 0; z-index: 6; display: flex; align-items: center; justify-content: center; padding: 22px;
  background: rgba(16, 12, 48, .55); border-radius: inherit; animation: citChatFade .15s ease-out; }
.cit-chat__confirm[hidden] { display: none; }
.cit-chat__confirm-card { width: 100%; max-width: 300px; background: var(--cc-bg); color: var(--cc-ink); border-radius: 16px; padding: 20px 18px 16px; text-align: center;
  box-shadow: 0 18px 48px rgba(10, 8, 30, .35); animation: citChatPop .18s ease-out; }
.cit-chat__confirm-ico { width: 44px; height: 44px; margin: 0 auto 10px; border-radius: 50%; display: grid; place-items: center; background: #fdecec; color: #d93a3f; }
.cit-chat__confirm-ico svg { width: 20px; height: 20px; }
.cit-chat__confirm-q { margin: 0; font-size: 16px; font-weight: 700; }
.cit-chat__confirm-s { margin: 6px 0 16px; font-size: 13px; color: var(--cc-muted); line-height: 1.45; }
.cit-chat__confirm-acts { display: flex; gap: 8px; }
.cit-chat__confirm-acts button { flex: 1; padding: 9px 12px; font-size: 13.5px; }
.cit-chat__confirm button, .cit-chat__survey-acts button { border-radius: 9px; padding: 6px 12px; font-size: 13px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--cc-line); background: var(--cc-bg); color: var(--cc-ink); }
.cit-chat__confirm .cit-chat__confirm-acts button { padding: 9px 12px; font-size: 13.5px; }
.cit-chat__confirm .is-danger { background: #d93a3f; border-color: transparent; color: #fff; }
.cit-chat__confirm .is-danger:hover { background: #b92f34; }
@keyframes citChatFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes citChatPop { from { opacity: 0; transform: translateY(6px) scale(.97); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .cit-chat__confirm, .cit-chat__confirm-card { animation: none; } }

/* "Turn on notifications?" offer, in the conversation */
.cit-chat__offer { gap: 8px; padding: 12px; }
.cit-chat__offer .cit-chat__survey-q2 { margin: 0; color: var(--cc-ink); }

/* After-chat survey */
.cit-chat__survey { align-self: stretch; background: var(--cc-bg); border: 1px solid var(--cc-line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.cit-chat__survey-q { margin: 0; font-weight: 700; font-size: 14.5px; text-align: center; }
.cit-chat__survey-q2 { margin: 0 0 6px; font-size: 13px; font-weight: 600; color: var(--cc-muted); }
.cit-chat__stars { display: flex; justify-content: center; gap: 4px; }
.cit-chat__star { border: 0; background: transparent; font-size: 30px; line-height: 1; color: #d6d3e8; cursor: pointer; padding: 2px; transition: transform .1s ease, color .1s ease; }
html.dark .cit-chat__star { color: #4a4670; }
.cit-chat__star:hover, .cit-chat__star:focus-visible { transform: scale(1.15); outline: none; }
.cit-chat__star.is-on { color: #f5b301; }
.cit-chat__survey-more[hidden] { display: none; }
.cit-chat__survey-more { display: flex; flex-direction: column; gap: 8px; }
.cit-chat__chips { display: flex; gap: 6px; }
.cit-chat__chip { flex: 1; border: 1px solid var(--cc-line); background: var(--cc-bg); color: var(--cc-ink); border-radius: 999px; padding: 6px 10px; font-size: 13px; font-weight: 600; cursor: pointer; }
.cit-chat__chip[aria-pressed="true"] { background: var(--cc-purple); border-color: transparent; color: #fff; }
.cit-chat__survey textarea { min-height: 54px; }
.cit-chat__survey-acts { display: flex; gap: 8px; justify-content: flex-end; }
.cit-chat__survey-acts .is-primary { background: var(--cc-purple); border-color: transparent; color: #fff; }
.cit-chat__survey-acts .is-primary:disabled { opacity: .5; cursor: default; }
.cit-chat__note--thanks { color: #0f7a4d; font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .cit-chat__star { transition: none; } }
