/* ============================================================
   CHAT WIDGET — Copilot Studio agent, design „Polštář“
   Vzhled obalu (bublina, panel, hlavička) i vnitřku chatu.
   Vše ostatní (adresa agenta, texty, styleOptions) je v chat-widget.js.

   Písma: Nunito + Baloo 2 = design Polštář, Inter + JetBrains Mono
   drží typografii Web Chatu a kódu. Když se Google Fonts nenačtou,
   jede widget na systémovém sans-serifu.

   Fonty se sem netahují přes @import — to by blokovalo parsování zbytku
   tohohle souboru a request na fonty by se spustil, až prohlížeč CSS
   dočte, místo souběžně s ním. Vkládá je chat-widget.js (funkce loadFonts)
   jako standardní <link>, který takhle neblokuje — a až při prvním otevření
   panelu, bublina žádné písmo nepotřebuje.
   ============================================================ */

/* Box-sizing jen uvnitř widgetu — do globálního resetu hostující stránky nesaháme.
   Naopak: hostující stránka může mít vlastní globální pravidla pro button, p, img
   a spol. (reset, framework) a ta by widgetu rozhodila rozměry, protože dědění
   i nenastavené vlastnosti prohrávají s jakýmkoli pravidlem hosta. Proto si prvky
   widgetu margin, padding, font a line-height říkají výslovně — plošný reset přes
   `#cw-root *` tady nejde, uvnitř leží i celý DOM Web Chatu. */
#cw-root,
#cw-root * { box-sizing: border-box; }

#cw-root {
  margin: 0;
  padding: 0;
  --cw-yellow: #ffcf00;
  --cw-grad: linear-gradient(160deg, #ffda3d, #ffcf00);
  --cw-cream: #fff9e0;             /* bubliny bota, pilulky, vstupní pole */
  --cw-ink: #151200;               /* text na žluté — nikdy bílý */
  --cw-text: #161a20;
  --cw-dim: #4e5763;
  --cw-line: rgba(80, 92, 108, .14);
  --cw-white: #fff;
  --cw-ease: cubic-bezier(.22, 1, .36, 1);
  font-family: "Nunito", sans-serif;
  color: var(--cw-text);
}

/* ---------- Bublina (launcher) ---------- */
/* margin/padding s !important: bublina i ikony v hlavičce jsou <button> a některé
   globální resety hostů si na button sahají taky přes !important — nula je tu
   správná hodnota, takže vynucením se nic nerozbije. */
#cw-launcher { position: fixed; right: 24px; bottom: 24px; z-index: 2147483000; margin: 0 !important; padding: 0 !important; width: 64px; height: 64px; display: grid; place-items: center; border: none; border-radius: 50%; cursor: pointer; background: var(--cw-grad); color: var(--cw-ink); box-shadow: 0 10px 28px rgba(255, 207, 0, .42), 0 2px 6px rgba(21, 18, 0, .14); transition: transform .3s var(--cw-ease), box-shadow .3s var(--cw-ease), opacity .25s var(--cw-ease); }
#cw-launcher:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 14px 34px rgba(255, 207, 0, .52), 0 2px 8px rgba(21, 18, 0, .18); }
#cw-launcher:active { transform: scale(.97); }
#cw-launcher:focus-visible { outline: 3px solid var(--cw-ink); outline-offset: 3px; }
#cw-launcher svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: opacity .2s var(--cw-ease), transform .3s var(--cw-ease); }
#cw-launcher .cw-x { position: absolute; opacity: 0; transform: rotate(-90deg) scale(.6); }
#cw-root.is-open #cw-launcher .cw-bubble { opacity: 0; transform: rotate(90deg) scale(.6); }
#cw-root.is-open #cw-launcher .cw-x { opacity: 1; transform: none; }

/* Prstenec, který pulzuje, dokud uživatel chat aspoň jednou neotevřel. */
#cw-launcher::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--cw-yellow); animation: cw-pulse 2.8s var(--cw-ease) infinite; }
#cw-root.is-seen #cw-launcher::after { display: none; }
@keyframes cw-pulse {
  0%        { transform: scale(1);    opacity: .7; }
  70%, 100% { transform: scale(1.55); opacity: 0; }
}

/* ---------- Panel ---------- */
#cw-panel { position: fixed; right: 24px; bottom: 100px; z-index: 2147483000; margin: 0; padding: 0; width: 400px; height: min(680px, calc(100vh - 140px)); display: flex; flex-direction: column; overflow: hidden; background: var(--cw-white); border: 1px solid var(--cw-line); border-radius: 28px; box-shadow: 0 24px 70px rgba(21, 24, 32, .18), 0 4px 14px rgba(21, 24, 32, .08); transform-origin: 100% 100%; opacity: 0; visibility: hidden; transform: translateY(14px) scale(.96); transition: opacity .28s var(--cw-ease), transform .28s var(--cw-ease), visibility .28s, width .28s var(--cw-ease), height .28s var(--cw-ease); }
#cw-root.is-open #cw-panel { opacity: 1; visibility: visible; transform: none; }
#cw-root.is-max #cw-panel { width: min(920px, calc(100vw - 48px)); height: calc(100vh - 140px); }

/* ---------- Hlavička ---------- */
.cw-head { flex: 0 0 auto; display: flex; align-items: center; gap: 12px; margin: 0; padding: 15px; background: linear-gradient(150deg, #ffe375, var(--cw-yellow)); color: var(--cw-ink); }
/* Dlaždice avatara je bílá kvůli logu — mezikruží je černé a klín žlutý,
   na žluté hlavičce by se klín ztratil. */
.cw-avatar { flex: 0 0 auto; margin: 0; padding: 0; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: var(--cw-white); }
.cw-avatar img { width: 22px; height: 22px; margin: 0; padding: 0; border: 0; display: block; }
.cw-titles { flex: 1 1 auto; min-width: 0; margin: 0; padding: 0; }
.cw-titles b { display: block; margin: 0; font-family: "Baloo 2", "Nunito", sans-serif; font-size: 1.04rem; font-weight: 700; line-height: 1.25; }
.cw-titles small { display: flex; align-items: center; gap: 6px; margin: 1px 0 0; font-family: "Nunito", sans-serif; font-size: .72rem; line-height: normal; letter-spacing: .01em; color: rgba(21, 18, 0, .64); }
.cw-status { flex: 0 0 auto; margin: 0; width: 6px; height: 6px; border-radius: 50%; background: #16a34a; box-shadow: 0 0 0 3px rgba(22, 163, 74, .22); }
.cw-status.is-off { background: #dc2626; box-shadow: 0 0 0 3px rgba(220, 38, 38, .22); }
.cw-actions { flex: 0 0 auto; display: flex; gap: 4px; margin: 0; padding: 0; }
.cw-ico { margin: 0 !important; padding: 0 !important; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; cursor: pointer; background: rgba(255, 255, 255, .62); border: 1px solid transparent; color: var(--cw-ink); transition: background .22s var(--cw-ease), border-color .22s var(--cw-ease), transform .22s var(--cw-ease); }
.cw-ico:hover { background: rgba(255, 255, 255, .92); border-color: rgba(21, 18, 0, .2); }
.cw-ico:active { transform: scale(.94); }
.cw-ico:focus-visible { outline: 2px solid var(--cw-ink); outline-offset: 2px; }
.cw-ico svg {width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* Tlačítko zvětšení překlápí ikonu podle stavu panelu. */
#cw-root.is-max .cw-ico[data-act="max"] .cw-i-out { display: none; }
#cw-root:not(.is-max) .cw-ico[data-act="max"] .cw-i-in { display: none; }

/* ---------- Tělo ----------
   #cw-webchat je normální flex prvek s definovanou výškou, ne absolutně
   pozicovaný — Web Chat si výšku měří při mountu a v absolutním hostu
   uvnitř skrytého panelu se mu to nemusí povést. */
.cw-body { position: relative; flex: 1 1 auto; min-height: 0; display: flex; margin: 0; padding: 0; background: var(--cw-white); }
#cw-webchat { flex: 1 1 auto; min-width: 0; min-height: 0; margin: 0; padding: 0; }

/* Překryv při načítání; po připojení dostane .is-hidden, při chybě .is-error. */
.cw-load { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; align-content: center; gap: 14px; margin: 0; padding: 28px; text-align: center; background: var(--cw-white); transition: opacity .35s var(--cw-ease), visibility .35s; }
.cw-load.is-hidden { opacity: 0; visibility: hidden; }
.cw-dots { display: flex; gap: 7px; margin: 0; padding: 0; }
.cw-dots i { width: 9px; height: 9px; margin: 0; border-radius: 50%; background: var(--cw-yellow); animation: cw-bounce 1.25s var(--cw-ease) infinite; }
.cw-dots i:nth-child(2) { animation-delay: .15s; }
.cw-dots i:nth-child(3) { animation-delay: .3s; }
.cw-load.is-error .cw-dots { display: none; }
@keyframes cw-bounce {
  0%, 60%, 100% { transform: translateY(0);    opacity: .45; }
  30%           { transform: translateY(-8px); opacity: 1; }
}
.cw-load p { margin: 0; font-family: "JetBrains Mono", monospace; font-size: .62rem; letter-spacing: .1em; line-height: 1.8; text-transform: uppercase; color: #7c8798; max-width: 34ch; }
.cw-load.is-error p { font-size: .72rem; letter-spacing: .02em; text-transform: none; color: var(--cw-dim); }
.cw-load button { font-family: "Inter", sans-serif; font-size: .8rem; font-weight: 600; line-height: normal; cursor: pointer; margin: 0; padding: 9px 16px; border: none; border-radius: 12px; color: var(--cw-ink); background: var(--cw-grad); box-shadow: 0 6px 20px rgba(255, 207, 0, .3); }
.cw-load button:focus-visible { outline: 2px solid var(--cw-ink); outline-offset: 2px; }

/* ---------- Patička ---------- */
/* Bez uppercase — v patičce je název firmy, ten se sází, jak se píše. */
.cw-foot { flex: 0 0 auto; margin: 0; padding: 9px 14px; text-align: center; border-top: 1px solid var(--cw-line); background: #fffbec; font-family: "Nunito", sans-serif; font-size: .7rem; line-height: normal; letter-spacing: .01em; color: #7c8798; }
.cw-foot b { margin: 0; color: var(--cw-text); font-weight: 600; }

/* ---------- Mobil a omezené animace ---------- */
@media (max-width: 520px) {
  #cw-panel,
  #cw-root.is-max #cw-panel { right: 0; bottom: 0; left: 0; width: 100%; height: 100dvh; border: none; border-radius: 0; }
  #cw-root.is-open #cw-launcher { opacity: 0; pointer-events: none; }
  .cw-ico[data-act="max"] { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  #cw-launcher::after { animation: none; }
  .cw-dots i { animation-duration: 2.4s; }
  #cw-panel,
  #cw-launcher,
  #cw-launcher svg { transition-duration: .01ms; }
}

/* ============================================================
   VNITŘEK CHATU — CSS na to, co styleOptions neumí.
   Názvy tříd webchat__* patří Bot Framework Web Chatu a mohou se
   mezi verzemi měnit; proto samostatná sekce a !important.
   ============================================================ */

/* Bubliny: gradient a asymetrický rádius (styleOptions bere jen plnou barvu a jedno číslo). */
#cw-webchat .webchat__bubble--from-user .webchat__bubble__content { background: var(--cw-grad) !important; border-color: transparent !important; border-radius: 20px 20px 7px 20px !important; color: var(--cw-ink) !important; box-shadow: 0 4px 14px rgba(255, 207, 0, .35); }
#cw-webchat .webchat__bubble:not(.webchat__bubble--from-user) .webchat__bubble__content { background: var(--cw-cream) !important; border-color: transparent !important; border-radius: 20px 20px 20px 7px !important; box-shadow: 0 1px 3px rgba(21, 24, 32, .05); }
#cw-webchat .webchat__bubble { max-width: 88% !important; }
/* Nunito jen na obal bubliny, ne na <p>/<li> uvnitř. Text zprávy si Web Chat
   sází sám `primaryFont`em (Inter) přímo na <p>, takže na něj dědění z obalu
   nedosáhne — a stejně to vypadá i v původní verzi widgetu. Kdyby měly být
   zprávy v Nunitu, přidej sem selektory `… __content p` a `… __content li`. */
#cw-webchat .webchat__bubble__content { padding: 2px 4px !important; font-family: "Nunito", sans-serif !important; }
/* Web Chat jede defaultně na 15 px, což je v úzkém panelu zbytečně velké —
   styleOptions na velikost písma ve zprávách vlastnost nemá. */
#cw-webchat .webchat__bubble__content,
#cw-webchat .webchat__bubble__content p,
#cw-webchat .webchat__bubble__content li { font-size: .82rem !important; line-height: 1.58 !important; }

/* Přepis začíná nahoře, ne dole — Web Chat vkládá mezi hlavičku a první zprávu
   rozpínavou výplň, takže v rozjeté konverzaci zpráva visí nalepená na vstupním
   poli a nad ní je půl okna prázdné. */
#cw-webchat [class*="__filler"] { display: none !important; }

/* Avatary — dlaždici dostanou rovnou obrázky, ne kontejnery Web Chatu: názvy jeho
   tříd se mezi verzemi mění, ale img[src] je naše. Bot = bílá dlaždice s logem,
   uživatel = tmavá s ikonou postavičky (ta je nakreslená do krajů, proto ne kruh). */
#cw-webchat img[src*="logo.png"] { background: var(--cw-white); border-radius: 9px; padding: 4px; }
#cw-webchat img[src*="user.svg"] { background: var(--cw-ink); border-radius: 9px; }
/* Kdyby se obrázek nenačetl, ať jsou iniciály aspoň čitelné. */
#cw-webchat [class*="nitialsAvatar"] { background: var(--cw-ink) !important; color: var(--cw-yellow) !important; font-family: "JetBrains Mono", monospace !important; font-weight: 600 !important; }

/* Odkazy, odrážky a kód ve zprávách — Web Chat mačká seznamy k okraji. */
#cw-webchat .webchat__bubble__content a { color: var(--cw-text); font-weight: 600; text-decoration: underline; text-decoration-color: var(--cw-yellow); text-decoration-thickness: 2px; text-underline-offset: 2px; }
#cw-webchat .webchat__bubble__content ul,
#cw-webchat .webchat__bubble__content ol { padding-left: 22px !important; margin: 6px 0 !important; }
#cw-webchat .webchat__bubble__content li { margin: 3px 0 !important; }
#cw-webchat .webchat__bubble__content code { font-family: "JetBrains Mono", monospace; font-size: .82em; background: rgba(80, 92, 108, .1); padding: 2px 5px; border-radius: 5px; }

/* Citace zdrojů v textu — Web Chat je renderuje jako <button class="…citation">1</button>
   a hranaté závorky dokresluje sám přes ::before/::after v barvě accent (žlutá na krémové
   bublině je skoro nečitelná a splývá s podtrženými odkazy okolo). Místo toho drobný
   kulatý štítek — čitelný, jasně klikatelný, bez podtržení. */
#cw-webchat .webchat__render-markdown__citation { display: inline-flex !important; align-items: center; justify-content: center; min-width: 15px; height: 15px; margin: 0 1px; padding: 0 4px !important; border-radius: 50% !important; background: rgba(255, 207, 0, .24) !important; color: var(--cw-ink) !important; font-family: "JetBrains Mono", monospace !important; font-size: .62rem !important; font-weight: 600; line-height: 1; text-decoration: none !important; vertical-align: 2px; cursor: pointer; transition: background .2s var(--cw-ease); }
#cw-webchat .webchat__render-markdown__citation::before,
#cw-webchat .webchat__render-markdown__citation::after { content: none !important; }
#cw-webchat .webchat__render-markdown__citation:hover { background: rgba(255, 207, 0, .42) !important; }
#cw-webchat .webchat__render-markdown__citation:focus-visible { outline: 2px solid var(--cw-ink) !important; outline-offset: 1px; }

/* Seznam zdrojů pod zprávou („N odkazy“) — jinak holý text se šedou číslicí, splývající
   s okolím. Sjednoceno s vizuálem karet: krémový podklad, kulaté rohy, žlutý kroužek
   s číslem místo obyčejné číslice. */
#cw-webchat .webchat__link-definitions { margin-top: 8px !important; font-family: "Nunito", sans-serif !important; }
#cw-webchat .webchat__link-definitions__header { display: flex !important; align-items: center; gap: 4px; cursor: pointer; font-family: "Nunito", sans-serif !important; font-size: .68rem !important; font-weight: 600 !important; color: var(--cw-dim) !important; list-style: none; }
#cw-webchat .webchat__link-definitions__header::-webkit-details-marker { display: none; }
#cw-webchat .webchat__link-definitions__header-chevron { color: var(--cw-dim); transition: transform .2s var(--cw-ease); }
#cw-webchat .webchat__link-definitions[open] .webchat__link-definitions__header-chevron { transform: rotate(180deg); }
#cw-webchat .webchat__link-definitions__list { display: flex !important; flex-direction: column; gap: 6px; margin-top: 6px !important; }
#cw-webchat .webchat__link-definitions__list-item-box { width: 100% !important; display: flex !important; align-items: center; gap: 8px; padding: 7px 10px !important; background: var(--cw-cream) !important; border: 1px solid transparent !important; border-radius: 16px !important; cursor: pointer; transition: border-color .2s var(--cw-ease), background .2s var(--cw-ease); }
#cw-webchat .webchat__link-definitions__list-item-box:hover { background: #fff2c2 !important; }
#cw-webchat .webchat__link-definitions__list-item-box:focus-visible { outline: 2px solid var(--cw-ink); outline-offset: 1px; }
#cw-webchat .webchat__link-definitions__badge { flex: 0 0 auto; width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; background: var(--cw-grad) !important; color: var(--cw-ink) !important; font-family: "JetBrains Mono", monospace !important; font-size: .62rem !important; font-weight: 700; }
#cw-webchat .webchat__link-definitions__list-item-text { font-family: "Nunito", sans-serif !important; font-size: .76rem !important; color: var(--cw-text) !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Okno s náhledem zdroje (klik na citaci) — <dialog> v top-layer, takže ho panel
   neořezává; vlastní styl, jinak je to holý text na bílé s 10px křížkem. */
#cw-webchat .webchat__modal-dialog { padding: 0 !important; font-family: "Nunito", sans-serif !important; color: var(--cw-text); }
#cw-webchat .webchat__modal-dialog::backdrop { background: rgba(21, 18, 0, .5); }
#cw-webchat .webchat__modal-dialog__box { display: flex !important; flex-direction: column; width: min(560px, 100%) !important; min-width: 0 !important; max-width: 100% !important; max-height: calc(100dvh - 32px); background: #fffdf4 !important; border-radius: 20px !important; box-shadow: 0 20px 60px rgba(21, 18, 0, .35) !important; }
#cw-webchat .webchat__modal-dialog__close-button-layout { float: none !important; align-self: flex-end; flex: 0 0 auto; padding: 8px 8px 0 !important; }
#cw-webchat .webchat__modal-dialog__close-button { width: 44px !important; height: 44px !important; border-radius: 50% !important; background: var(--cw-cream) !important; cursor: pointer; }
#cw-webchat .webchat__modal-dialog__close-button:hover { background: #fff2c2 !important; }
#cw-webchat .webchat__modal-dialog__close-button-border { display: grid; place-items: center; }
#cw-webchat .webchat__modal-dialog__close-button-image { width: 16px !important; height: 16px !important; fill: var(--cw-ink) !important; }
#cw-webchat .webchat__modal-dialog__body { margin: 0 !important; padding: 4px 20px 20px; flex: 1 1 auto; min-height: 0; overflow-y: auto; font-size: .82rem; line-height: 1.58; overflow-wrap: anywhere; }
#cw-webchat .webchat__modal-dialog__body p,
#cw-webchat .webchat__modal-dialog__body li { font-family: "Nunito", sans-serif !important; font-size: .82rem !important; line-height: 1.58 !important; white-space: pre-line; }
#cw-webchat .webchat__citation-modal-dialog__header { margin: 0 0 8px; font-family: "Baloo 2", "Nunito", sans-serif; font-size: 1.04rem; font-weight: 700; line-height: 1.25; }

/* Palce pod odpovědí — Web Chat je barví `accent`em, žlutá na bílé je nečitelná. */
#cw-webchat .webchat__thumb-button__image { color: var(--cw-dim) !important; }
#cw-webchat .webchat__thumb-button:hover .webchat__thumb-button__image,
#cw-webchat .webchat__thumb-button[aria-pressed="true"] .webchat__thumb-button__image { color: var(--cw-ink) !important; }

/* Rychlé odpovědi (suggested actions) — krémové pilulky, na hover žlutý gradient. */
#cw-webchat .webchat__suggested-action { border: 1px solid transparent !important; border-radius: 100px !important; background: var(--cw-cream) !important; font-family: "Nunito", sans-serif !important; font-size: .76rem !important; font-weight: 700 !important; transition: background .2s var(--cw-ease), box-shadow .2s var(--cw-ease) !important; }
#cw-webchat .webchat__suggested-action:hover { background: var(--cw-grad) !important; box-shadow: 0 4px 14px rgba(255, 207, 0, .35) !important; }
#cw-webchat .webchat__suggested-action:focus-visible { outline: 2px solid var(--cw-ink) !important; outline-offset: 2px !important; }

/* Vstupní pole a tlačítka pod ním. Pilulka vstupu potřebuje odsazení, jinak
   se lepí na okraj panelu i na linku nad sebou. */
#cw-webchat .webchat__send-box { border-top: 1px solid var(--cw-line) !important; }
#cw-webchat .webchat__send-box-text-box { background: var(--cw-cream) !important; border-radius: 100px !important; margin: 6px 4px 6px 12px !important; }
#cw-webchat .webchat__send-box-text-box__input,
#cw-webchat .webchat__send-box-text-box__text-area { font-family: "Nunito", sans-serif !important; font-size: 16px !important; } /* <16 px = iOS při focusu přiblíží stránku */
/* Odeslat: klikací plocha min. 44×44 px, ikona větší. */
#cw-webchat .webchat__send-box__button { min-width: 44px; min-height: 44px; }
#cw-webchat .webchat__send-box__button svg { width: 22px; height: 22px; }
#cw-webchat .webchat__send-box__button:hover,
#cw-webchat .webchat__icon-button:hover { background: rgba(255, 207, 0, .16) !important; border-radius: 10px; }

/* Indikátor psaní — Web Chat vykresluje `.webchat__typing-indicator` jako prázdný <div>
   bez obsahu i animace (ověřeno v DOM), takže bez téhle sekce je to jen statický
   obdélník. Tři tečky i jejich „chození“ dokreslujeme jedním ::after (druhá a třetí
   tečka jsou jeho box-shadow), protože potomky do prázdného prvku přidat nejde. */
#cw-webchat .webchat__typing-indicator,
#cw-webchat .webchat__typingIndicator { position: relative; min-width: 44px; background: var(--cw-cream) !important; border-radius: 20px 20px 20px 7px !important; color: var(--cw-yellow) !important; }
#cw-webchat .webchat__typing-indicator::after,
#cw-webchat .webchat__typingIndicator::after { content: ""; position: absolute; top: 50%; left: 50%; width: 5px; height: 5px; border-radius: 50%; transform: translate(-16.5px, -50%); background: rgba(255, 207, 0, .85); box-shadow: 14px 0 0 rgba(255, 207, 0, .85), 28px 0 0 rgba(255, 207, 0, .85); animation: cw-typing-dots 1.2s ease-in-out infinite; }
@keyframes cw-typing-dots {
  0%, 100% { background: rgba(255, 207, 0, .85); box-shadow: 14px 0 0 rgba(255, 207, 0, .25), 28px 0 0 rgba(255, 207, 0, .25); }
  33%      { background: rgba(255, 207, 0, .25); box-shadow: 14px 0 0 rgba(255, 207, 0, .85), 28px 0 0 rgba(255, 207, 0, .25); }
  66%      { background: rgba(255, 207, 0, .25); box-shadow: 14px 0 0 rgba(255, 207, 0, .25), 28px 0 0 rgba(255, 207, 0, .85); }
}
@media (prefers-reduced-motion: reduce) {
  #cw-webchat .webchat__typing-indicator::after,
  #cw-webchat .webchat__typingIndicator::after { animation: none; background: rgba(255, 207, 0, .6); box-shadow: 14px 0 0 rgba(255, 207, 0, .6), 28px 0 0 rgba(255, 207, 0, .6); }
}

/* Scrollbar v transkriptu a tlačítko „skočit dolů“. */
#cw-webchat .webchat__basic-transcript__scrollable { scrollbar-width: thin; scrollbar-color: rgba(80, 92, 108, .35) transparent; }
#cw-webchat .webchat__basic-transcript__scrollable::-webkit-scrollbar { width: 8px; }
#cw-webchat .webchat__basic-transcript__scrollable::-webkit-scrollbar-thumb { background: rgba(80, 92, 108, .28); border-radius: 100px; }
#cw-webchat .webchat__basic-transcript__scrollable::-webkit-scrollbar-thumb:hover { background: rgba(80, 92, 108, .45); }
#cw-webchat .webchat__scroll-to-end-button { background: var(--cw-grad) !important; color: var(--cw-ink) !important; border: none !important; border-radius: 100px !important; font-family: "Inter", sans-serif !important; font-weight: 600 !important; box-shadow: 0 6px 18px rgba(255, 207, 0, .35) !important; }

/* ============================================================
   ADAPTIVE CARDS — formuláře a karty od agenta.
   Třídy ac-* patří knihovně AdaptiveCards, ne Web Chatu, takže jsou
   mezi verzemi stabilnější než webchat__*. Typografii a barvy řeší
   ADAPTIVE_CARD_HOST_CONFIG v chat-widget.js; tady jsou jen tvary,
   aby karta nevypadala jako cizí formulář uvnitř chatu.
   ============================================================ */
#cw-webchat .ac-adaptiveCard { background: transparent !important; padding: 4px 2px !important; }
/* Karta potřebuje víc místa než odstavec textu. */
#cw-webchat .webchat__bubble:not(.webchat__bubble--from-user):has(.ac-adaptiveCard) { max-width: 96% !important; }
#cw-webchat .ac-textBlock,
#cw-webchat .ac-input-label,
#cw-webchat .ac-input,
#cw-webchat .ac-pushButton { font-family: "Nunito", sans-serif !important; }
#cw-webchat .ac-image { border-radius: 10px; }
#cw-webchat .ac-input-label { font-size: .78rem !important; font-weight: 600 !important; color: var(--cw-text) !important; margin-bottom: 4px !important; }
/* Pole: krémová plocha, jemný obrys, žlutý focus — jako vstupní řádek chatu.
   Stačí .ac-input, tu třídu má každý vstup (.ac-textInput a spol. jen přibývají). */
#cw-webchat .ac-input { font-size: 16px !important; line-height: 1.5 !important; width: 100% !important; box-sizing: border-box !important; padding: 9px 12px !important; color: var(--cw-text) !important; background: #fffdf4 !important; border: 1px solid rgba(21, 18, 0, .12) !important; border-radius: 16px !important; box-shadow: none !important; }
#cw-webchat .ac-input:focus { outline: 2px solid var(--cw-yellow) !important; outline-offset: 0 !important; border-color: transparent !important; }
#cw-webchat .ac-input::placeholder { color: #8c887c !important; opacity: 1; }
#cw-webchat textarea.ac-input { min-height: 78px !important; resize: vertical !important; }
#cw-webchat .ac-input[type="checkbox"],
#cw-webchat .ac-input[type="radio"],
#cw-webchat .ac-choiceSetInput input { width: auto !important; accent-color: var(--cw-yellow); }
/* Tlačítka karty: první je hlavní akce (žlutá pilulka), další vedlejší. */
#cw-webchat .ac-actionSet { margin-top: 12px !important; }
#cw-webchat .ac-pushButton { font-size: .8rem !important; font-weight: 700 !important; padding: 10px 16px !important; cursor: pointer; border: 1px solid transparent !important; border-radius: 100px !important; background: var(--cw-grad) !important; color: var(--cw-ink) !important; box-shadow: 0 4px 14px rgba(255, 207, 0, .3) !important; transition: transform .2s var(--cw-ease), box-shadow .2s var(--cw-ease) !important; }
#cw-webchat .ac-pushButton:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(255, 207, 0, .4) !important; }
#cw-webchat .ac-pushButton:focus-visible { outline: 2px solid var(--cw-ink) !important; outline-offset: 2px; }
#cw-webchat .ac-actionSet .ac-pushButton:not(:first-child) { background: var(--cw-white) !important; border-color: rgba(21, 18, 0, .2) !important; box-shadow: none !important; }
#cw-webchat .ac-actionSet .ac-pushButton:not(:first-child):hover { background: #f4f4f1 !important; }
