/* Clearpol demo chat renderer (lane C, demos-v2) — cpchat/1.
   Styles for the scripted conversation the chat slot ([data-cpd-chat]) renders.
   Uses the page's own --cp3-* variables, so it follows the section theme.
   Keyboard: every control is a real button or link with a visible focus ring.
   Reduced motion: no dots, no scroll animation, no flash transition. */

.cpc{margin-top:14px;border:1px solid var(--cp3-hair,#e5e5ee);border-radius:14px;background:var(--cp3-paper,#fff);color:var(--cp3-ink,#111);padding:18px;max-width:640px}
.cpc-head{display:flex;align-items:center;gap:12px}
.cpc-ava{display:inline-grid;place-items:center;width:48px;height:48px;border-radius:50%;overflow:hidden;background:var(--cp3-tint,#f2f2f8);color:var(--cp3-indigo,#3b3b6e);font-size:.9rem;font-weight:600;flex:none}
.cpc-ava img{width:48px;height:48px;display:block}
.cpc-id{display:flex;align-items:baseline;gap:8px;flex-wrap:wrap}
.cpc-id b{font-size:1.05rem}
.cpc-tag{border:1px solid var(--cp3-hair,#e5e5ee);border-radius:999px;padding:1px 9px;color:var(--cp3-meta,#777);font-size:.72rem}
.cpc-title{margin:12px 0 2px;font-size:1.2rem;letter-spacing:-.01em;text-wrap:balance}   /* fix 1: the role never splits over two lines at 390 */
.cpc-note{margin:0 0 4px;color:var(--cp3-meta,#777);font-size:.9rem;text-wrap:balance}      /* fix 2: no lone "made up." (pretty still left it alone in Chromium; balance evens the two lines) */
.cpc-nb{white-space:nowrap}   /* fix 8: "in-services", "P-100", "Firestop Co." never break */
@media (max-width:399.98px){ .cpc-tag{display:none} }   /* fix 5: the "AI agent" pill would drop to its own line under long roles */
.cpc-log{display:flex;flex-direction:column;gap:8px;margin-top:10px}
.cpc-line{max-width:92%;padding:9px 13px;border-radius:14px;font-size:.98rem;line-height:1.45}
.cpc-line--agent{align-self:flex-start;background:var(--cp3-tint,#f2f2f8);border-bottom-left-radius:4px}
.cpc-line--me{align-self:flex-end;background:var(--cp3-signal);color:#fff;border-bottom-right-radius:4px}
.cpc-line--step{align-self:flex-start;background:var(--cp3-tint,#f2f2f8);border-bottom-left-radius:4px}
.cpc-line--step .cpc-n{color:var(--cp3-meta,#777);font-size:.85rem;margin-right:6px}
.cpc-dots{align-self:flex-start;display:flex;gap:4px;padding:12px 13px}
.cpc-dots i{width:5px;height:5px;border-radius:50%;background:var(--cp3-meta,#999);animation:cpc-blink 1s infinite}
.cpc-dots i:nth-child(2){animation-delay:.15s}
.cpc-dots i:nth-child(3){animation-delay:.3s}
@keyframes cpc-blink{0%,100%{opacity:.25}50%{opacity:1}}
@media (prefers-reduced-motion: reduce){
  .cpc-dots{display:none}
}
.cpc-ctl{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
.cpc-btn{display:inline-flex;align-items:center;min-height:40px;padding:6px 16px;border-radius:999px;border:1px solid var(--cp3-hair,#e5e5ee);background:var(--cp3-paper,#fff);color:var(--cp3-ink,#111);font:inherit;font-size:.95rem;cursor:pointer;text-align:left}
@media (prefers-reduced-motion: no-preference){
  .cpc-btn{transition:border-color .2s var(--cp3-ease,ease),background-color .2s var(--cp3-ease,ease)}
}
.cpc-btn:hover{border-color:var(--cp3-signal)}
.cpc-btn:focus-visible{outline:2px solid var(--cp3-signal);outline-offset:2px}
.cpc-btn--go{border-color:var(--cp3-signal);background:var(--cp3-signal);color:#fff}
.cpc-btn--link{text-decoration:none}
.cpc-show{border-style:dashed;color:var(--cp3-indigo,#3b3b6e);min-height:32px;padding:3px 12px;font-size:.88rem}
.cpc-cta{display:inline-flex;align-items:center;min-height:44px;padding:8px 20px;border-radius:999px;background:var(--cp3-signal);color:#fff;font:inherit;font-size:1rem;text-decoration:none}
.cpc-cta:focus-visible{outline:2px solid var(--cp3-indigo);outline-offset:2px}

/* Fix 6: faded preview of the greeting before Start, only beside the pinned sample (duo), where
   the short card left ~550 px of white. Capped by chat-slot.js (--cpd-pre-max) so it never makes
   the row taller than the sample; fades out at the bottom. On Start the lines become the greeting. */
.cpc-pre{display:none}
.cpc-line--wait{display:none}
@media (min-width:1069px){
  .cpd-duo .cpc-pre{display:flex;flex-direction:column;gap:8px;margin-top:14px;max-height:var(--cpd-pre-max,320px);overflow:hidden;
    -webkit-mask-image:linear-gradient(to bottom,#000 45%,transparent);mask-image:linear-gradient(to bottom,#000 45%,transparent);pointer-events:none;user-select:none}
  .cpd-duo .cpc-line--pre{opacity:.5}
}
@media (prefers-reduced-motion: no-preference){ .cpc-line{transition:opacity .3s ease} }

/* The momentary outline a "Show me" button puts on a part of the sample. */
.cpc-flash{outline:2px solid var(--cp3-signal);outline-offset:2px;border-radius:4px}
@media (prefers-reduced-motion: no-preference){
  .cpc-flash{transition:outline-color .4s ease}
}

/* ── Duo layout (Design Lead's 1440 pick, Tally 22:04): from 1069px up, chat LEFT at
   its current width (never widened), the page's own sample RIGHT, pinned sticky just
   under the page menu. Built at run time by chat-slot.js as a DOM move of the existing
   sample node (no markup edit). Below 1069: unchanged (stacked). The site's own
   breakpoint is the same 1068/1069 line. */
@media (min-width: 1069px){
  /* two flexible tracks: the chat card inside is capped at its current 640px (never
     widened), and the sample keeps a 340px floor even at the 1069 edge */
  .cpd-duo{display:grid;grid-column:1/-1;grid-template-columns:minmax(280px,1fr) minmax(340px,1fr);gap:var(--cp3-gap,24px);align-items:start;margin-top:22px}
  .cpd-duo-chat{min-width:0}
  .cpd-duo-demo{min-width:0;position:sticky;top:var(--cpd-sticky-top,96px)}
  .cpd-duo .cpd{grid-column:auto}   /* undo the stacked split rule */
  /* squeeze: when the sample shares the row with the chat, release its 148px side
     menu and fixed status columns so it uses the narrow column well (Design Lead,
     Tally 14:04). Scope: duo mode only, and never the report-style window. */
  .cpd-duo-demo .cpk-win:not(.cpk-win--report){grid-template-columns:minmax(0,1fr)}
  .cpd-duo-demo .cpk-win:not(.cpk-win--report) > .cpk-side{display:none}
  /* optional 3 (Design Lead): in the narrow duo column the Pause control and the "Sample screen" note jammed
     side by side (note wrapped to two lines against Pause); let them wrap onto their own lines, right-aligned */
  /* fix 7: ONE Pause layout (batch 1's): Pause with its word on its own line at the right, the
     note below it in one shared width, left-aligned, no lone last word. Same for every page,
     incl. the static samples (no Pause) and the bare-icon Pause buttons (the word added below). */
  .cpd-duo-demo .cpk-demo-foot{flex-direction:column;flex-wrap:nowrap;align-items:flex-end;justify-content:flex-start;row-gap:4px}
  .cpd-duo-demo .cpk-demo-foot>span{width:min(284px,100%);text-wrap:balance}
  /* fix 7: a flag card in the normal flow (the healthcare hub) floats like the workflow pages' cards,
     so the caption sits under its own sample instead of ~200 px below, past the card */
  .cpd-duo-demo .cpk-demo>.cpk-ai:not(.cpk-ai--float):not(.cpk-ai--right){z-index:2;grid-column:1;max-width:304px;margin:-20px 0 0 16px;justify-self:start}
  .cpd-duo-demo .cpk-demo>.cpk-ai:not(.cpk-ai--float):not(.cpk-ai--right)+.cpk-demo-foot{grid-column:2;align-self:start}
  /* fix 3: a sample taller than the screen is not pinned; the chat column pins and scrolls beside it */
  .cpd-duo.cpd-tall .cpd-duo-demo{position:static}
  .cpd-duo.cpd-tall .cpd-duo-chat{position:sticky;top:var(--cpd-chat-top,77px);max-height:calc(100vh - var(--cpd-chat-top,77px) - 16px);overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}
  /* fix 4: the pinned sample's top under the page menu fades out over 12 px at the menu line
     instead of showing text cut in half. The padding/negative margin keeps the flag card's shadow
     inside the masked box (no visible change in layout). */
  .cpd-duo-demo{padding:0 20px 64px;margin:0 -20px -64px}
  .cpd-duo.cpd-faded .cpd-duo-demo{-webkit-mask-image:linear-gradient(to bottom,transparent var(--cpd-fade-y,0px),#000 calc(var(--cpd-fade-y,0px) + 12px));mask-image:linear-gradient(to bottom,transparent var(--cpd-fade-y,0px),#000 calc(var(--cpd-fade-y,0px) + 12px))}
  /* fallback pages: one column, chat centred, never full width */
  .cpd.cpd-center{max-width:720px;margin-left:auto;margin-right:auto}
}
@media (max-width: 1068px){
  .cpd.cpd-center{max-width:720px;margin-left:auto;margin-right:auto}
}
/* fix 7: a bare-icon Pause button gets its word, like every other page ("Play" while paused) */
.cpk-demo-foot .cpk-pause:not(:has(>span))::after{content:"Pause"}
.cpk-demo-foot .cpk-pause[aria-pressed="true"]:not(:has(>span))::after{content:"Play"}
/* Fallback pages keep one column at every width (chat centred, max 720px). The duo
   container never exists for them. */
/* Pause polish (Tally 08:4x): keep the Pause button and its icon at their natural size, so at 390 the icon does not shrink away and the note wraps instead of touching "Pause" */
.cpk-demo-foot .cpk-pause,.cpk-demo-foot .cpk-pause svg{flex:none}
