/* Cuba: chat widget. Farby sa riadia tokenmi z style-new.css (svetly aj tmavy rezim). */
.cuba { position: fixed; left: 20px; bottom: 20px; z-index: 2500; font-family: var(--font-body, 'Inter', system-ui, sans-serif); font-size: 15px; line-height: 1.45; }
.cuba *, .cuba *::before, .cuba *::after { box-sizing: border-box; }

.cuba__fab {
  display: flex; align-items: center; gap: 10px;
  height: 52px; padding: 0 20px 0 16px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--c-accent, #0066ff); color: #fff; font: 600 15px/1 var(--font-body, 'Inter', system-ui, sans-serif);
  box-shadow: 0 10px 28px -8px rgba(0, 102, 255, .55), 0 2px 6px rgba(0, 0, 0, .18);
  transition: transform .18s ease, box-shadow .18s ease, padding .25s ease, gap .25s ease;
}
.cuba__fab span { max-width: 160px; overflow: hidden; white-space: nowrap; transition: max-width .25s ease, opacity .2s ease; }
/* po odscrollovani z vrchu ostane len ikona */
.cuba.is-compact:not(.is-open) .cuba__fab { gap: 0; padding: 0 15px; }
.cuba.is-compact:not(.is-open) .cuba__fab span { max-width: 0; opacity: 0; }
.cuba__fab:hover { transform: translateY(-2px); }
.cuba__fab:focus-visible, .cuba__send:focus-visible, .cuba__close:focus-visible, .cuba__chip:focus-visible { outline: 3px solid var(--c-accent-2, #22d3ee); outline-offset: 2px; }
.cuba__fab svg { width: 22px; height: 22px; flex: none; }
.cuba.is-open .cuba__fab { display: none; }

.cuba__panel {
  position: relative;
  display: none; flex-direction: column;
  width: min(380px, calc(100vw - 24px)); height: min(560px, calc(100vh - 40px)); height: min(560px, calc(100dvh - 40px));
  background: var(--c-bg, #fff); color: var(--c-text, #0f172a);
  border: 1px solid var(--c-border, #e2e8f0); border-radius: 18px; overflow: hidden;
  box-shadow: 0 30px 70px -20px rgba(10, 16, 32, .45), 0 4px 14px rgba(10, 16, 32, .12);
}
.cuba.is-open .cuba__panel { display: flex; animation: cuba-in .22s ease-out; }
@keyframes cuba-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }

.cuba__head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--c-accent, #0066ff); color: #fff; }
.cuba__avatar { width: 36px; height: 36px; border-radius: 50%; background: rgba(255, 255, 255, .18); display: grid; place-items: center; flex: none; font: 700 17px/1 var(--font-display, 'Montserrat', sans-serif); }
.cuba__title { flex: 1; min-width: 0; }
.cuba__title strong { display: block; font: 700 16px/1.2 var(--font-display, 'Montserrat', sans-serif); }
.cuba__title span { font-size: 12.5px; opacity: .85; }
.cuba__close { width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: #fff; cursor: pointer; display: grid; place-items: center; }
.cuba__close:hover { background: rgba(255, 255, 255, .16); }
.cuba__close svg { width: 18px; height: 18px; }
.cuba__trash { width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: #fff; cursor: pointer; display: grid; place-items: center; flex: none; }
.cuba__trash:hover { background: rgba(255, 255, 255, .16); }
.cuba__trash svg { width: 18px; height: 18px; }
.cuba__trash:focus-visible { outline: 3px solid var(--c-accent-2, #22d3ee); outline-offset: 2px; }
.cuba__confirm { position: absolute; inset: 0; z-index: 3; display: flex; align-items: flex-start; justify-content: center; padding: 76px 16px 0; background: rgba(10, 16, 32, .45); }
.cuba__confirm[hidden] { display: none; }
.cuba__confirm-card { width: 100%; background: var(--c-bg, #fff); color: var(--c-text, #0f172a); border: 1px solid var(--c-border, #e2e8f0); border-radius: 14px; padding: 16px; box-shadow: 0 18px 40px -12px rgba(10, 16, 32, .5); }
.cuba__confirm-card strong { display: block; font: 700 15.5px/1.3 var(--font-display, 'Montserrat', sans-serif); }
.cuba__confirm-card p { margin: 6px 0 14px; font-size: 13.5px; line-height: 1.45; color: var(--c-text-muted, #475569); }
.cuba__confirm-btns { display: flex; gap: 8px; }
.cuba__confirm-btns button { flex: 1; border-radius: 10px; padding: 10px 12px; font: 600 14px/1.2 var(--font-body, 'Inter', sans-serif); cursor: pointer; }
.cuba__confirm-yes { border: 0; background: #d92d20; color: #fff; }
.cuba__confirm-no { border: 1px solid var(--c-border-strong, #cbd5e1); background: transparent; color: var(--c-text, #0f172a); }
.cuba__confirm-btns button:focus-visible { outline: 3px solid var(--c-accent-2, #22d3ee); outline-offset: 2px; }
.cuba__msg--note { align-self: center; background: transparent; color: var(--c-text-faint, #8a97ad); font-size: 12.5px; padding: 2px 8px; }

.cuba__log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--c-bg-alt, #f4f7fb); overscroll-behavior: contain; }
.cuba__msg { max-width: 86%; padding: 10px 13px; border-radius: 16px; overflow-wrap: anywhere; white-space: pre-wrap; }
.cuba__msg--bot { align-self: flex-start; background: var(--c-surface, #fff); border: 1px solid var(--c-border, #e2e8f0); border-bottom-left-radius: 5px; }
.cuba__msg--user { align-self: flex-end; background: var(--c-accent, #0066ff); color: #fff; border-bottom-right-radius: 5px; }
.cuba__msg--err { align-self: flex-start; background: transparent; border: 1px dashed var(--c-danger, #dc2626); color: var(--c-danger, #dc2626); font-size: 13.5px; }
.cuba__msg a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.cuba__msg--bot a { color: var(--c-accent, #0066ff); }

.cuba__typing { display: inline-flex; gap: 4px; padding: 4px 2px; }
.cuba__typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--c-text-faint, #8a97ad); animation: cuba-dot 1s infinite ease-in-out; }
.cuba__typing i:nth-child(2) { animation-delay: .15s; }
.cuba__typing i:nth-child(3) { animation-delay: .3s; }
@keyframes cuba-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.cuba__chips { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 2px; }
.cuba__chip { border: 1px solid var(--c-accent, #0066ff); background: transparent; color: var(--c-accent, #0066ff); border-radius: 999px; padding: 7px 12px; font: 500 13.5px/1.2 var(--font-body, 'Inter', sans-serif); cursor: pointer; }
.cuba__chip:hover { background: var(--c-accent-soft, rgba(0, 102, 255, .1)); }

.cuba__form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--c-border, #e2e8f0); background: var(--c-bg, #fff); }
.cuba__input { flex: 1; min-width: 0; border: 1px solid var(--c-border-strong, #cbd5e1); border-radius: 12px; padding: 11px 13px; background: var(--c-bg, #fff); color: var(--c-text, #0f172a); font: 400 16px/1.3 var(--font-body, 'Inter', sans-serif); }
.cuba__input::placeholder { color: var(--c-text-faint, #8a97ad); }
.cuba__input:focus { outline: 2px solid var(--c-accent, #0066ff); outline-offset: 0; border-color: transparent; }
.cuba__send { width: 44px; border: 0; border-radius: 12px; background: var(--c-accent, #0066ff); color: #fff; cursor: pointer; display: grid; place-items: center; flex: none; }
.cuba__send:disabled { opacity: .5; cursor: default; }
.cuba__send svg { width: 20px; height: 20px; }
.cuba__note { padding: 0 14px 10px; background: var(--c-bg, #fff); font-size: 11.5px; color: var(--c-text-faint, #8a97ad); text-align: center; }

:root[data-theme="dark"] .cuba__panel { box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .8), 0 0 0 1px var(--c-border); }
:root[data-theme="dark"] .cuba__msg--bot { background: rgba(255, 255, 255, .06); }
:root[data-theme="dark"] .cuba__form,
:root[data-theme="dark"] .cuba__note { background: var(--c-bg); }
:root[data-theme="dark"] .cuba__fab,
:root[data-theme="dark"] .cuba__head,
:root[data-theme="dark"] .cuba__msg--user,
:root[data-theme="dark"] .cuba__send { background: #1a6dff; }

@media (max-width: 520px) {
  .cuba { left: 12px; bottom: 12px; }
  .cuba__fab { height: 54px; }
  .cuba.is-open { right: 0; bottom: 0; left: 0; }
  .cuba__panel { width: 100vw; height: 100vh; height: 100dvh; border-radius: 0; border: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .cuba__fab, .cuba__fab span, .cuba.is-open .cuba__panel { animation: none; transition: none; }
  .cuba__typing i { animation: none; opacity: .6; }
}
