/* The chat look shared by the widget, the hosted page, Try it and the inbox.
   Each surface keeps its own message classes and sizes its bubbles from these values. */
:root {
  --ck-radius: 18px;
  --ck-tail: 8px;
  --ck-recv: #eceef1;
  --ck-recv-ink: #14161c;
  --ck-sent: var(--blue);
  --ck-sent-ink: var(--on-blue, #fff);
  --ck-face: 26px;
  --ck-gutter: 34px;
  --ck-ease: cubic-bezier(0.22, 1, 0.36, 1);
}
html[data-theme="dark"],
.widget-page[data-theme="dark"] {
  --ck-recv: #2d2d33;
  --ck-recv-ink: #f1f1f3;
}
.dashboard-page { --ck-sent-ink: #fff; }
html[data-theme="dark"] .dashboard-page { --ck-sent: var(--theme-primary); }

/* A sender's name sits over the first bubble of a stack, lined up with the bubble rather than the face. */
.ck-name {
  margin: 0 0 3px var(--ck-gutter);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
}
.ck-line {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 100%;
}
.ck-face {
  flex: none;
  display: grid;
  place-items: center;
  width: var(--ck-face);
  height: var(--ck-face);
  overflow: hidden;
  border-radius: 50%;
  background: var(--ck-recv);
  color: var(--ck-recv-ink);
  font-size: 11px;
  font-weight: 600;
}
.ck-face.is-spacer { visibility: hidden; }
.ck-face > svg,
.ck-face > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ck-face.is-mark > svg { width: 14px; height: 14px; }

/* A message's time waits beside the bubble until it's hovered or tapped, so nothing moves. */
.ck-time {
  position: absolute;
  bottom: 9px;
  left: calc(100% + 8px);
  color: var(--muted);
  font-size: 11.5px;
  line-height: 15px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
.ck-time.is-left { right: calc(100% + 8px); left: auto; }
:is(.is-time, :hover) > .ck-line > .ck-time,
.is-time .ck-time { opacity: 1; }

/* The AI at work: a short list of real steps, no bubble. */
.ck-trail {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 4px 0;
  font-size: 13px;
  line-height: 18px;
}
.ck-step {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
}
.ck-step > svg { flex: none; width: 14px; height: 14px; }
.ck-step.is-done > svg { color: var(--green); }
.ck-spin { animation: ck-spin 0.7s linear infinite; }
.ck-shim {
  color: transparent;
  background:
    linear-gradient(90deg, transparent calc(50% - 2.5em), var(--ink), transparent calc(50% + 2.5em)),
    linear-gradient(color-mix(in srgb, var(--ink) 48%, transparent), color-mix(in srgb, var(--ink) 48%, transparent));
  background-repeat: no-repeat;
  background-size: 250% 100%, auto;
  -webkit-background-clip: text;
  background-clip: text;
  animation: ck-sweep 2s linear infinite;
}

/* "Checked 2 help articles" above an answer, which opens to the articles it used. */
.ck-sum {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0 0 5px var(--ck-gutter);
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  line-height: 17px;
  cursor: pointer;
}
.ck-sum:hover { color: var(--ink); }
.ck-sum:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 3px; }
.ck-sum svg { width: 12px; height: 12px; transition: transform 0.2s var(--ck-ease); }
.ck-sum[aria-expanded="true"] svg { transform: rotate(90deg); }
.ck-src {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 0 0 7px var(--ck-gutter);
  padding-left: 10px;
  border-left: 2px solid var(--line);
  font-size: 12.5px;
  line-height: 18px;
}
.ck-src[hidden] { display: none; }
.ck-src-item {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
}
a.ck-src-item:hover { text-decoration: underline; }
.ck-src-item svg { flex: none; width: 13px; height: 13px; color: var(--muted); }
.ck-src-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* A person typing: their face, a short line and small dots. */
.ck-typing {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 18px;
}
.ck-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 14px;
}
.ck-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.45;
  animation: ck-hop 0.55s linear infinite;
}
.ck-dots i:nth-child(2) { animation-delay: 0.1s; }
.ck-dots i:nth-child(3) { animation-delay: 0.2s; }

/* A word mid-reveal. Words return to plain inline text once settled, so lines wrap normally. */
.ck-w { display: inline-block; }
.is-settled .ck-w { display: inline; }

@keyframes ck-spin { to { transform: rotate(360deg); } }
@keyframes ck-sweep { from { background-position: 100% 0, 0 0; } to { background-position: 0% 0, 0 0; } }
@keyframes ck-hop {
  0%, 90%, 100% { opacity: 0.45; transform: none; }
  45% { opacity: 1; transform: translateY(-4px); }
}
@media (prefers-reduced-motion: reduce) {
  .ck-spin, .ck-shim, .ck-dots i { animation: none; }
  .ck-shim { color: var(--muted); background: none; }
  .ck-time, .ck-sum svg { transition: none; }
}
