/* Izolace chatového formuláře od stylů okolní stránky. */
#oksi-chat-root .oc-header { min-width: 0; }
#oksi-chat-root .oc-header > div:nth-child(2) { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
#oksi-chat-root .oc-close { flex: 0 0 auto; width: 40px; min-width: 40px; max-width: 40px; height: 40px; margin-left: auto; padding: 0; box-shadow: none; }
#oksi-chat-root .oc-form { width: 100%; min-width: 0; margin: 0; }
#oksi-chat-root .oc-compose { display: flex; flex-direction: row; align-items: stretch; width: 100%; min-width: 0; gap: 8px; }
#oksi-chat-root .oc-compose textarea { display: block; flex: 1 1 0%; width: 0; min-width: 0; max-width: none; height: 48px; min-height: 48px; max-height: 96px; margin: 0; padding: 12px; box-sizing: border-box; font-size: 16px; line-height: 1.4; }
#oksi-chat-root .oc-compose .oc-send { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; width: auto; min-width: 88px; max-width: 112px; height: 48px; min-height: 48px; margin: 0; padding: 0 12px; box-sizing: border-box; white-space: nowrap; font-size: 14px; }
#oksi-chat-root .oc-launch { width: auto; min-width: 0; max-width: calc(100vw - 32px); }
@media (max-width: 600px) {
  #oksi-chat-root { right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); }
  #oksi-chat-root .oc-window { right: 0; bottom: 60px; width: min(380px, calc(100vw - 24px)); height: min(520px, calc(100vh - 105px)); height: min(520px, calc(100dvh - 105px)); max-height: calc(100dvh - 105px); border-radius: 16px; }
  #oksi-chat-root .oc-header { padding: 12px; gap: 9px; }
  #oksi-chat-root .oc-avatar { width: 42px; height: 42px; }
  #oksi-chat-root .oc-title { font-size: 15px; line-height: 1.25; }
  #oksi-chat-root .oc-sub { font-size: 12px; line-height: 1.35; }
  #oksi-chat-root .oc-messages { min-height: 0; padding: 12px; }
  #oksi-chat-root .oc-bubble { font-size: 14px; line-height: 1.45; padding: 10px 12px; }
  #oksi-chat-root .oc-form { padding: 10px; }
  #oksi-chat-root .oc-note { font-size: 11px; line-height: 1.4; }
  #oksi-chat-root .oc-launch { padding: 12px 16px; font-size: 14px; }
}
@media (max-width: 320px) { #oksi-chat-root .oc-compose .oc-send { min-width: 74px; padding: 0 8px; } }

/* Na desktopu zůstává text, na mobilu pouze ikona. */
#oksi-chat-root .oc-launch-icon { display: none; }
@media (max-width: 600px) {
  #oksi-chat-root .oc-launch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    min-width: 58px;
    max-width: 58px;
    height: 58px;
    padding: 0;
    border-radius: 50%;
    animation: oksi-chat-attention 10s ease-in-out infinite;
  }
  #oksi-chat-root .oc-launch-icon { display: inline-flex; align-items: center; justify-content: center; }
  #oksi-chat-root .oc-launch-label { display: none; }
  #oksi-chat-root .oc-launch[aria-expanded="true"] { animation: none; }
}
@keyframes oksi-chat-attention {
  0%, 93%, 100% { transform: rotate(0); filter: brightness(1); }
  94% { transform: rotate(-8deg); filter: brightness(1.28); }
  95% { transform: rotate(8deg); filter: brightness(1.08); }
  96% { transform: rotate(-6deg); filter: brightness(1.3); }
  97% { transform: rotate(6deg); filter: brightness(1.05); }
  98% { transform: rotate(-3deg); filter: brightness(1.2); }
  99% { transform: rotate(0); filter: brightness(1); }
}
@media (prefers-reduced-motion: reduce) {
  #oksi-chat-root .oc-launch { animation: none; }
}
