/* Realitní AI Chat 2.0 – styly. Barvy a pozici nastavuje plugin (proměnné --rac-*). */

.rac {
  --rac-accent: #F4C243;
  --rac-on-accent: #1D1D1B;
  --rac-dark: #2B2B2B;
  --rac-on-dark: #fff;
  --rac-ink: #2B2B2B;
  --rac-muted: #77776F;
  --rac-faint: #A9A9A1;
  --rac-line: #E4E4DE;
  --rac-surface: #F7F7F4;
  --rac-ok: #3DBE8B;
  --rac-bottom: 20px;
  --rac-side: 20px;
  position: fixed;
  right: var(--rac-side);
  bottom: var(--rac-bottom);
  z-index: 99999;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.5;
  color: var(--rac-ink);
}
.rac--left { right: auto; left: var(--rac-side); }

/* Zobrazit launcher až po krátké prodlevě po načtení stránky. */
.rac.rac-not-ready { visibility: hidden; opacity: 0; pointer-events: none; }
.rac:not(.rac-not-ready) { visibility: visible; opacity: 1; transition: opacity .35s ease; }

.rac *, .rac *::before, .rac *::after { box-sizing: border-box; }
.rac button { all: unset; box-sizing: border-box; cursor: pointer; font-family: inherit; }
.rac button:focus-visible,
.rac a:focus-visible { outline: 2px solid var(--rac-dark); outline-offset: 2px; }
.rac .rac-panel button:focus-visible { outline-offset: -2px; }
.rac .rac-head button:focus-visible { outline-color: var(--rac-on-dark); }

/* ---------- Ikona ---------- */

.rac .rac-svg { display: block; width: 100%; height: 100%; }
.rac .rac-i-b { fill: currentColor; }
.rac .rac-i-h { fill: var(--rac-accent); }
.rac .rac-i-s { fill: currentColor; stroke: var(--rac-accent); stroke-width: 1.5; stroke-linejoin: round; paint-order: stroke; }
.rac .rac-img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: contain; background: #fff; padding: 5px; }
.rac .rac-img.rac-photo { object-fit: cover; padding: 0; background: transparent; }

.rac .rac-launcher {
  position: relative;
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: #FDC003;
  color: #fff;
  box-shadow: 0 0 0 3px #fff, 0 8px 22px rgba(20, 20, 20, .22);
  isolation: isolate;
  transition: transform .15s ease;
}
.rac .rac-launcher:hover { transform: scale(1.05); }
.rac .rac-launcher .rac-ic-open { display: grid; place-items: center; width: 38px; height: 38px; }
.rac .rac-launcher-chat-icon { display: block; width: 34px; height: 34px; color: #fff; }
.rac .rac-online-dot { position: absolute; top: -3px; right: -3px; width: 14px; height: 14px; border: 2px solid #fff; border-radius: 50%; background: #20C987; box-shadow: 0 1px 5px rgba(0,0,0,.16); z-index: 3; }
.rac .rac-launcher .rac-ic-open:has(.rac-img) { width: 100%; height: 100%; }
.rac .rac-launcher .rac-ic-close { display: none; }
.rac .rac-unread {
  position: absolute;
  top: -4px;
  left: -4px;
  display: none;
  min-width: 23px;
  height: 23px;
  padding: 0 5px;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #E53935;
  color: #fff;
  font: 700 11px/1 Arial, sans-serif;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
  z-index: 2;
}
.rac .rac-unread.rac-unread--on { display: flex; }
.rac .rac-launcher.rac-has-new { animation: rac-notify .65s ease-in-out 2; }
@keyframes rac-notify {
  0%, 100% { transform: rotate(0) scale(1); }
  20% { transform: rotate(-8deg) scale(1.04); }
  40% { transform: rotate(7deg) scale(1.04); }
  60% { transform: rotate(-5deg) scale(1.02); }
  80% { transform: rotate(3deg) scale(1.01); }
}
.rac.rac-open .rac-launcher .rac-unread { display: none !important; }
.rac.rac-open .rac-launcher .rac-online-dot { display: none; }
.rac.rac-open .rac-launcher .rac-ic-open { display: none; }
.rac.rac-open .rac-launcher .rac-ic-close { display: grid; }

/* Pulzující halo: jedna vlna (3,2 s), pak 2 s klid, a znovu.
   Běží, dokud chat návštěvník poprvé neotevře. */
.rac .rac-launcher::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 50%;
  background: var(--rac-accent);
  pointer-events: none;
  animation: rac-pulse 5.2s ease-out infinite;
}
.rac.rac-open .rac-launcher::before,
.rac.rac-calm .rac-launcher::before { animation: none; opacity: 0; }
@keyframes rac-pulse {
  0%        { transform: scale(1);   opacity: .5; }
  61.5%     { transform: scale(1.9); opacity: 0; }  /* 3,2 s pohybu */
  100%      { transform: scale(1.9); opacity: 0; }  /* 2 s pauzy */
}

/* Bublina u ikony */
.rac .rac-teaser {
  white-space: pre-line;
  text-align: left;
  position: absolute;
  bottom: 10px;
  right: 78px;
  width: var(--rac-teaser-width-desktop, 280px);
  max-width: min(var(--rac-teaser-width-desktop, 280px), calc(100vw - 110px));
  padding: 13px 16px;
  border-radius: 14px 14px 4px 14px;
  background: var(--rac-teaser-bg, var(--rac-accent));
  color: var(--rac-teaser-color, var(--rac-on-accent));
  font-size: var(--rac-teaser-font-desktop, 14px);
  font-weight: 700;
  line-height: 1.4;
  border: 1px solid rgba(0,0,0,.08);
  box-shadow: 0 8px 26px rgba(20, 20, 20, .25);
  opacity: 0;
  transform: translateX(8px);
  pointer-events: none;
  transition: opacity .35s ease, transform .35s ease;
}
.rac--left .rac-teaser { right: auto; left: 78px; border-radius: 14px 14px 14px 4px; transform: translateX(-8px); }
.rac .rac-teaser.rac-teaser--on { opacity: 1; transform: none; pointer-events: auto; }

/* ---------- Okno ---------- */

.rac .rac-panel {
  position: absolute;
  right: 0;
  bottom: 78px;
  display: flex;
  flex-direction: column;
  width: 400px;
  height: min(680px, calc(100vh - var(--rac-bottom) - 110px));
  height: min(680px, calc(100dvh - var(--rac-bottom) - 110px));
  background: var(--rac-surface);
  border-radius: 26px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(20, 20, 20, .28), 0 0 0 1px rgba(20, 20, 20, .06);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(.98);
  transform-origin: bottom right;
  transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
}
.rac--left .rac-panel { right: auto; left: 0; transform-origin: bottom left; }
.rac.rac-open .rac-panel {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity .18s ease, transform .18s ease, visibility 0s;
}

/* záhlaví */
.rac .rac-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 16px 18px 20px;
  color: var(--rac-on-dark);
  background: var(--rac-dark);
}
.rac .rac-avatar {
  display: block;
  flex: none;
  width: 50px;
  height: 50px;
  padding: 9px;
  border-radius: 50%;
  background: var(--rac-accent);
  color: var(--rac-on-accent);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .22);
}
.rac .rac-avatar:has(.rac-img) { padding: 0; }
.rac .rac-headtxt { flex: 1; min-width: 0; }
.rac .rac-title { font-size: 18px; font-weight: 700; line-height: 1.25; }
.rac .rac-status {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 3px;
  font-size: 13px;
  line-height: 1.3;
  opacity: .8;
}
.rac .rac-status i { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--rac-ok); }
.rac .rac-hb {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .13);
  color: var(--rac-on-dark);
  transition: background .15s ease;
}
.rac .rac-hb:hover { background: rgba(255, 255, 255, .24); }
.rac .rac-head .rac-hb + .rac-hb { margin-left: -6px; }

/* ---------- Konverzace ---------- */

.rac .rac-log {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 18px 10px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--rac-surface);
}

.rac .rac-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12.5px;
  color: var(--rac-faint);
}
.rac .rac-divider::before,
.rac .rac-divider::after { content: ""; flex: 1; height: 1px; background: var(--rac-line); }

.rac .rac-msg { display: flex; gap: 10px; }
.rac .rac-msg--user { justify-content: flex-end; }

.rac .rac-mav {
  display: block;
  flex: none;
  width: 32px;
  height: 32px;
  padding: 6px;
  margin-top: 2px;
  border-radius: 50%;
  background: var(--rac-accent);
  color: var(--rac-on-accent);
}
.rac .rac-mav:has(.rac-img) { padding: 0; }
.rac .rac-mav--ghost { visibility: hidden; }
.rac .rac-mbody { min-width: 0; max-width: calc(100% - 42px); }
.rac .rac-who { margin-bottom: 1px; font-size: 13px; color: var(--rac-muted); }

.rac .rac-bubble { overflow-wrap: anywhere; }
.rac .rac-msg--bot .rac-bubble { font-size: 15.5px; line-height: 1.5; color: var(--rac-ink); }
.rac .rac-msg--user .rac-bubble {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 18px 18px 6px 18px;
  background: var(--rac-accent);
  color: var(--rac-on-accent);
}
.rac .rac-msg--error .rac-bubble {
  padding: 9px 13px;
  border-radius: 12px;
  background: #FBEDEA;
  color: #8A2A1B;
}
.rac .rac-bubble a { color: inherit; text-decoration: underline; }

.rac .rac-typing { display: flex; gap: 5px; align-items: center; padding: 10px 0 4px; }
.rac .rac-typing i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--rac-muted);
  opacity: .5;
  animation: rac-dot 1s infinite ease-in-out;
}
.rac .rac-typing i:nth-child(2) { animation-delay: .15s; }
.rac .rac-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes rac-dot { 0%, 80%, 100% { transform: translateY(0); } 40% { transform: translateY(-4px); } }

/* rychlé odpovědi: mřížka 2 × 3 */
.rac .rac-chips { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rac .rac-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 62px;
  padding: 10px 12px;
  border: 1.5px solid var(--rac-line);
  border-radius: 16px;
  background: #fff;
  color: var(--rac-dark);
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.rac .rac-chip:hover { border-color: var(--rac-accent); box-shadow: 0 4px 14px rgba(20, 20, 20, .09); }

/* ---------- Kontaktní formulář ---------- */

.rac .rac-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--rac-line);
  border-top: 3px solid var(--rac-accent);
  border-radius: 16px;
  background: #fff;
}
.rac .rac-card-t { font-weight: 700; }
.rac .rac-f { display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: var(--rac-muted); }
.rac .rac-f input {
  width: 100%;
  margin: 0;
  padding: 9px 10px;
  border: 1px solid #CFCFCA;
  border-radius: 10px;
  background: #fff;
  color: var(--rac-ink);
  font: inherit;
  font-size: 15px;
  box-shadow: none;
}
.rac .rac-f input:focus { outline: 2px solid var(--rac-dark); outline-offset: 0; border-color: transparent; }
.rac .rac-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.rac .rac-check { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; line-height: 1.4; color: var(--rac-muted); cursor: pointer; }
.rac .rac-check input { flex: none; width: 16px; height: 16px; margin: 1px 0 0; accent-color: var(--rac-dark); }
.rac .rac-check a { color: var(--rac-dark); text-decoration: underline; }
.rac .rac-err { min-height: 0; font-size: 13px; color: #B3321F; }
.rac .rac-err:empty { display: none; }
.rac .rac-submit {
  display: block;
  padding: 11px 14px;
  border-radius: 12px;
  background: var(--rac-accent);
  color: var(--rac-on-accent);
  font-weight: 700;
  text-align: center;
}
.rac .rac-submit:hover { filter: brightness(.96); }
.rac .rac-submit:disabled { opacity: .6; cursor: default; }

/* ---------- Psaní zprávy ---------- */

.rac .rac-form { padding: 8px 16px 6px; background: var(--rac-surface); }
.rac .rac-inputwrap {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 8px 8px 16px;
  border: 1.5px solid #D6D6D0;
  border-radius: 20px;
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.rac .rac-inputwrap:focus-within { border-color: var(--rac-dark); box-shadow: 0 0 0 4px rgba(20, 20, 20, .07); }
.rac .rac-inputwrap textarea {
  flex: 1;
  min-width: 0;
  max-height: 96px;
  margin: 0;
  padding: 9px 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--rac-ink);
  font: inherit;
  font-size: 15.5px;
  line-height: 1.4;
  resize: none;
  box-shadow: none;
}
.rac .rac-inputwrap textarea::placeholder { color: var(--rac-faint); }
.rac .rac-count { flex: none; padding-bottom: 12px; font-size: 12px; color: var(--rac-faint); }
.rac .rac-send {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--rac-accent);
  color: var(--rac-on-accent);
  box-shadow: 0 4px 10px rgba(20, 20, 20, .14);
}
.rac .rac-send:hover { filter: brightness(.96); }
.rac .rac-send:disabled { opacity: .5; cursor: default; box-shadow: none; }

.rac .rac-foot {
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 4px 16px 14px;
  background: var(--rac-surface);
  font-size: 12.5px;
}
.rac .rac-foot a { color: var(--rac-muted); text-decoration: none; }
.rac .rac-foot a:hover,
.rac .rac-lead-link:hover { text-decoration: underline; }
.rac .rac-lead-link { color: var(--rac-dark); font-weight: 700; }

/* ---------- Mobil ---------- */

@media (max-width: 767px) {
  .rac { bottom: var(--rac-bottom-mobile) !important; }
  .rac .rac-teaser {
    width: var(--rac-teaser-width-mobile, 190px);
    max-width: min(var(--rac-teaser-width-mobile, 190px), calc(100vw - 100px));
    padding: 9px 11px;
    font-size: var(--rac-teaser-font-mobile, 12px);
    line-height: 1.35;
    font-weight: 650;
  }
  .rac .rac-panel {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    box-shadow: none;
  }
  .rac .rac-head { padding-top: calc(18px + env(safe-area-inset-top, 0px)); }
  .rac .rac-foot { padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
  .rac.rac-open .rac-launcher { display: none; }
  /* 16 px zabrání iOS v automatickém přiblížení při psaní */
  .rac .rac-inputwrap textarea,
  .rac .rac-f input { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .rac .rac-launcher.rac-has-new { animation: none !important; }
  .rac .rac-panel,
  .rac .rac-teaser,
  .rac .rac-launcher { transition: none; }
  .rac .rac-typing i { animation: none; }
  /* bez pohybu: klidné statické halo */
  .rac:not(.rac-open):not(.rac-calm) .rac-launcher::before { animation: none; opacity: .28; transform: scale(1.35); }
}

/* Šablony často stylují button:hover (např. černé pozadí). Tady každému tlačítku
   stav hover/focus/active výslovně určíme, ať se vzhled nikdy nepřebije. */
.rac .rac-launcher:hover, .rac .rac-launcher:focus, .rac .rac-launcher:active,
.rac .rac-teaser:hover, .rac .rac-teaser:focus, .rac .rac-teaser:active,
.rac .rac-submit:hover, .rac .rac-submit:focus, .rac .rac-submit:active,
.rac .rac-send:hover, .rac .rac-send:focus, .rac .rac-send:active {
  background: var(--rac-accent);
  color: var(--rac-on-accent);
  border: 0;
  text-shadow: none;
}
.rac .rac-launcher:hover, .rac .rac-launcher:focus, .rac .rac-launcher:active { background: #FDC003; color: #fff; }
.rac .rac-teaser:hover, .rac .rac-teaser:focus, .rac .rac-teaser:active {
  background: var(--rac-teaser-bg, var(--rac-accent));
  color: var(--rac-teaser-color, var(--rac-on-accent));
}
.rac .rac-hb:focus, .rac .rac-hb:active { background: rgba(255, 255, 255, .13); color: var(--rac-on-dark); border: 0; }
.rac .rac-hb:hover { background: rgba(255, 255, 255, .24); color: var(--rac-on-dark); border: 0; }
.rac .rac-chip:hover, .rac .rac-chip:focus, .rac .rac-chip:active {
  background: #fff;
  color: var(--rac-dark);
  text-shadow: none;
}
.rac .rac-lead-link:hover, .rac .rac-lead-link:focus, .rac .rac-lead-link:active {
  background: none;
  color: var(--rac-dark);
  border: 0;
  box-shadow: none;
  text-shadow: none;
}

/* Lead form clarity – version 2.0.9 */
.rac-card-intro{margin:6px 0 12px;color:#666;font-size:.92em;line-height:1.45}
