/* ==========================================================================
   Chatbots page only (chatbots.html, _build/chat_page.py). Loaded after
   systems.css; behaviour is in systems.js.
   ========================================================================== */

#bots { padding-bottom: clamp(36px, 4.5vw, 60px); }
.ch-k { margin: 0; font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase; color: #70757a; }
.ch-mono--grey { background: #8C95A0; }

/* ---- message bubbles, shared by the hero and the comparison ---------------------- */
.ch-thread { display: grid; gap: 7px; padding: 12px; }
.ch-b { max-width: 82%; margin: 0; padding: 8px 11px; border-radius: 14px; font-size: 12.5px; line-height: 1.45; }
.ch-b small { display: block; margin-top: 3px; font-size: 9.5px; color: #8a8f94; }
.ch-b--them { justify-self: end; border-bottom-right-radius: 4px; background: #202124; color: #fff; }
.ch-b--them small { color: rgba(255, 255, 255, .6); }
.ch-b--us { justify-self: start; border-bottom-left-radius: 4px; background: #f1f1ee; color: #202124; }

/* ---- hero ------------------------------------------------------------------------ */
.ch-web { position: relative; }
.ch-web__page { display: grid; gap: 10px; padding: 16px; height: 330px; box-sizing: border-box; }
.ch-web__page i { height: 10px; border-radius: 100px; background: #eeeeeb; }
.ch-web__page i:first-child { width: 55%; height: 18px; }
.ch-web__page i:nth-child(2) { width: 80%; }
.ch-web__page i:nth-child(4) { height: 60px; width: 45%; border-radius: 8px; }
.ch-widget { position: absolute; right: 10px; bottom: 10px; width: 262px; border-radius: 14px; background: #fff; box-shadow: 0 16px 36px -10px rgba(0, 0, 0, .35); overflow: hidden; }
.ch-widget__h { display: flex; align-items: center; gap: 9px; margin: 0; padding: 10px 12px; border-bottom: 1px solid #eee; }
.ch-widget__h span { display: grid; }
.ch-widget__h b { font-size: 12.5px; }
.ch-widget__h small { font-size: 9.5px; color: #70757a; }
.ch-widget .ch-b { font-size: 11.5px; }
.ch-widget__in { display: flex; justify-content: space-between; margin: 0; padding: 9px 12px; border-top: 1px solid #eee; font-size: 11px; color: #8a8f94; }
.ch-widget__in span { color: #E2520F; font-weight: 700; }

.ch-msg__bar { display: flex; align-items: center; gap: 9px; padding: 10px 12px; background: #1f4d3a; color: #fff; }
.ch-msg__bar .sy-mono { width: 28px; height: 28px; }
.ch-msg__bar span { display: grid; }
.ch-msg__bar b { font-size: 13px; }
.ch-msg__bar small { font-size: 10px; opacity: .8; }
.ch-thread--msg { background: #efeae2; min-height: 250px; align-content: start; }
.ch-thread--msg .ch-b--them { background: #dcf3d0; color: #202124; }
.ch-thread--msg .ch-b--them small { color: #8a8f94; }
.ch-thread--msg .ch-b--us { background: #fff; }

.ch-team__bar { display: flex; align-items: baseline; gap: 10px; padding: 11px 14px; border-bottom: 1px solid #eee; font-size: 13px; font-weight: 700; }
.ch-team__bar small { font-weight: 400; font-size: 10.5px; color: #8a8f94; }
.ch-team { display: grid; gap: 12px; padding: 14px; }
.ch-team__m { display: grid; grid-template-columns: 30px 1fr; gap: 10px; margin: 0; font-size: 12.5px; line-height: 1.5; }
.ch-team__m > i { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 7px; background: #8C95A0; color: #fff; font-style: normal; font-weight: 700; }
.ch-team__m .sy-mono { width: 30px; height: 30px; }
.ch-team__m span { display: grid; }
.ch-team__m b { font-size: 12px; }
.ch-team__m em { margin-top: 5px; padding: 4px 8px; width: fit-content; border-radius: 6px; background: #eef1fb; color: #2F5BD3; font-style: normal; font-size: 10.5px; }
.ch-team__m--bot span { padding: 8px 10px; border-radius: 10px; background: rgba(226, 82, 15, .06); }

.ch-help { padding: 16px; display: grid; gap: 10px; }
.ch-help__h { display: flex; align-items: center; gap: 9px; margin: 0; font-size: 13px; font-weight: 700; }
.ch-help__q { display: flex; justify-content: space-between; margin: 0; padding: 10px 14px; border-radius: 100px; border: 1px solid #dfe1e5; font-size: 12.5px; }
.ch-help__a { display: grid; gap: 6px; padding: 12px; border-radius: 10px; background: #f7f6f2; font-size: 12.5px; line-height: 1.5; }
.ch-help__a p { margin: 0; }
.ch-help__src { display: flex; gap: 6px; }
.ch-help__src span { padding: 2px 8px; border-radius: 100px; background: #eef1fb; color: #2F5BD3; font-size: 10.5px; }
.ch-help__more { margin: 0; font-size: 11.5px; color: #70757a; }
.ch-help__more b { color: #E2520F; }

/* ---- try it: one chat, two messages to choose from per turn (chattry.js) --------------- */
.ch-try { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.ch-try__win {
  display: grid; grid-template-rows: auto 1fr auto; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #fff;
  box-shadow: 0 1px 2px rgba(20, 20, 20, .04), 0 30px 60px -36px rgba(20, 20, 20, .3);
}
.ch-try__win .ch-widget__h { padding: 14px 18px; }
.ch-try__win .ch-widget__h b { font-size: 14.5px; }
.ch-try__win .ch-widget__h small { display: flex; align-items: center; gap: 6px; font-size: 11px; }
.ch-live { width: 7px; height: 7px; border-radius: 50%; background: #2f9e5b; box-shadow: 0 0 0 3px rgba(47, 158, 91, .18); }
.ch-try__thread { display: grid; align-content: start; gap: 10px; height: 400px; overflow-y: auto; padding: 20px 18px; scroll-behavior: smooth; scrollbar-width: thin; }
.ch-try__thread .ch-b { max-width: 78%; padding: 10px 14px; border-radius: 18px; font-size: 15px; line-height: 1.5; }
.ch-try__thread .ch-b--them { border-bottom-right-radius: 5px; }
.ch-try__thread .ch-b--us { border-bottom-left-radius: 5px; }
.ch-try__thread .ch-b small { margin-top: 6px; font: 11px var(--font-mono); color: #6f7479; opacity: 0; transition: opacity 400ms var(--ease); }
.ch-try__thread .ch-b small.is-in { opacity: 1; }
.ch-try__thread .ch-b.is-new { animation: ch-pop 380ms cubic-bezier(.3, 1.4, .5, 1) both; }
.ch-b--them.is-new { transform-origin: 100% 100%; }
.ch-b--us.is-new { transform-origin: 0 100%; }
.ch-sys { justify-self: center; margin: 4px 0 0; padding: 5px 12px; border-radius: 100px; background: rgba(var(--ov), .05); font: 11px var(--font-mono); color: var(--text-2); }
.ch-sys.is-new { animation: ch-pop 380ms var(--ease) both; }
/* typing: three dots breathing in turn */
.ch-typing { display: inline-flex; gap: 5px; padding: 14px 16px !important; }
.ch-typing i { width: 7px; height: 7px; border-radius: 50%; background: #9a9ea3; animation: ch-dot 1.1s ease-in-out infinite; }
.ch-typing i:nth-child(2) { animation-delay: .15s; }
.ch-typing i:nth-child(3) { animation-delay: .3s; }
/* the reply arrives word by word */
.ch-w { opacity: 0; animation: ch-word 260ms var(--ease) forwards; }

.ch-try__send { padding: 14px 18px 18px; border-top: 1px solid #eee; background: #fafaf8; }
.ch-try__k { margin: 0 0 10px; font: 500 10.5px var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
.ch-try__opts { display: flex; flex-wrap: wrap; gap: 8px; min-height: 44px; }
.ch-opt {
  padding: 10px 16px; border: 1px solid #202124; border-radius: 100px; background: #fff; color: #202124;
  font: inherit; font-size: 14.5px; text-align: left; cursor: pointer; animation: ch-pop 380ms var(--ease) both;
  transition: background 180ms var(--ease), color 180ms var(--ease), transform 180ms var(--ease);
}
.ch-opt:nth-child(2) { animation-delay: 90ms; }
.ch-opt:hover { background: #202124; color: #fff; transform: translateY(-1px); }
.ch-opt:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.ch-opt--again { border-style: dashed; color: var(--text-2); }
.ch-try__opts.is-busy .ch-opt { animation: none; opacity: .35; pointer-events: none; }   /* animation off, or its fill holds opacity at 1 */

/* the pointers: small, and each lights when the reply that shows it arrives */
.ch-try__side { padding-top: 6px; }
.ch-pts { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 4px; }
.ch-pt { display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: start; padding: 10px 12px; border-left: 2px solid transparent; border-radius: 0 6px 6px 0; opacity: .5; transition: opacity 400ms var(--ease), background 400ms var(--ease), border-color 400ms var(--ease); }
.ch-pt span { display: grid; place-items: center; width: 22px; height: 22px; border: 1px solid var(--line-2); border-radius: 50%; font: 11px var(--font-mono); color: var(--text-3); transition: background 300ms, color 300ms, border-color 300ms; }
.ch-pt p { margin: 0; font-size: 13px; line-height: 1.4; color: var(--text-3); }
.ch-pt b { display: block; font-size: 14.5px; font-weight: 500; color: var(--text); }
.ch-pt.is-on { opacity: 1; }
.ch-pt.is-on span { border-color: var(--text); background: var(--text); color: #fff; }
.ch-pt.is-now { border-left-color: var(--orange); background: rgba(226, 82, 15, .07); }
.ch-try__fine { margin: 16px 0 0 12px; font-size: 11.5px; }
html:not(.sg-js) .ch-try__send { display: none; }

@keyframes ch-pop { from { opacity: 0; transform: translateY(8px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes ch-dot { 0%, 60%, 100% { transform: none; opacity: .45; } 30% { transform: translateY(-4px); opacity: 1; } }
@keyframes ch-word { from { opacity: 0; filter: blur(2px); } to { opacity: 1; filter: none; } }
@media (max-width: 900px) {
  .ch-try { grid-template-columns: 1fr; }
  .ch-try__thread { height: 360px; }
  .ch-pts { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) { .ch-pts { grid-template-columns: 1fr; } .ch-try__thread .ch-b { max-width: 88%; } }
@media (prefers-reduced-motion: reduce) {
  .ch-try *, .ch-try *::before { animation: none !important; transition: none !important; }
  .ch-w { opacity: 1; }
}

/* ---- the bubble columns ---------------------------------------------------------------- */
.ch-plan { fill: none; stroke: var(--text-3); stroke-width: 1; stroke-dasharray: 4 6; opacity: .45; }
.ch-c rect, .ch-c path { transition: opacity .35s var(--ease), fill .35s var(--ease); }
.ch-c--bot rect, .ch-c--bot path { fill: url(#syLine); }
.ch-c--person rect, .ch-c--person path { fill: rgba(47, 91, 211, .08); stroke: var(--cobalt); stroke-width: 1.3; }
.ch-c--test rect, .ch-c--test path { fill: rgba(var(--ov), .06); stroke: var(--text-3); stroke-width: 1; stroke-dasharray: 3 3; }
.ch-c--person path, .ch-c--test path { stroke: none; }
.sg-js .ch-c:not(.is-live) { opacity: 0; }
.ch-c { transition: opacity .3s var(--ease); }
.ch-launch path { stroke: var(--orange); stroke-width: 1.5; stroke-dasharray: 3 4; }
.ch-launch text { fill: var(--orange); font-size: 11px; letter-spacing: .14em; }
.sg-js .ch-launch:not(.is-live) { opacity: .25; }
.ch-legend text { fill: var(--text-3); font-size: 11px; letter-spacing: .08em; }
.sg-js .ch-legend .ch-c { opacity: 1; }   /* swatches are a key, not part of the build-up */
.ch-done { fill: none; stroke: url(#syLine); stroke-width: 4; stroke-linecap: round; }
/* each live week's share, and the running total it adds up to */
.ch-pct { fill: var(--text); font: 600 13px var(--font-mono); transition: opacity .3s var(--ease); }
.ch-pct--test { fill: var(--text-3); font-weight: 500; font-size: 10.5px; letter-spacing: .1em; }
.sg-js .ch-pct:not(.is-live) { opacity: 0; }
.ch-total__n { fill: var(--text); font-family: var(--font-display); font-size: 120px; letter-spacing: -.04em; }
.ch-total__pc { font-size: 64px; fill: var(--orange); }
.ch-total__l { fill: var(--text); font: 600 13px var(--font-mono); letter-spacing: .12em; }
.ch-total__s { fill: var(--text-3); font: 11px var(--font-mono); letter-spacing: .1em; }
@media (prefers-reduced-motion: reduce) { .ch-c, .ch-c rect { transition: none; } }
