/* Ozvebo AI asistent – chat widget */
.nwai-root {
  --nwai-accent: #0f766e;
  --nwai-accent-text: #ffffff;
  --nwai-bg: #ffffff;
  --nwai-surface: #f3f4f6;
  --nwai-text: #111827;
  --nwai-muted: #6b7280;
  --nwai-border: #e5e7eb;
  position: fixed;
  bottom: 20px;
  z-index: 2147483000;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--nwai-text);
  -webkit-font-smoothing: antialiased;
}
.nwai-root.nwai-pos-right { right: 20px; }
.nwai-root.nwai-pos-left { left: 20px; }
.nwai-root *, .nwai-root *::before, .nwai-root *::after { box-sizing: border-box; }

/* Reset proti štýlom témy */
.nwai-root button,
.nwai-root textarea {
  font-family: inherit;
  font-size: inherit;
  letter-spacing: normal;
  text-transform: none;
  margin: 0;
  box-shadow: none;
  min-height: 0;
  min-width: 0;
  line-height: 1.4;
}
.nwai-root button { cursor: pointer; }
.nwai-root [hidden] { display: none !important; }

/* Plávajúce tlačidlo */
.nwai-root .nwai-launcher {
  width: 60px;
  height: 60px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--nwai-accent);
  color: var(--nwai-accent-text);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 28px -8px rgba(17, 24, 39, 0.45), 0 2px 6px rgba(17, 24, 39, 0.15);
  transition: transform 0.18s ease, filter 0.18s ease;
  margin-left: auto;
}
.nwai-root.nwai-pos-left .nwai-launcher { margin-left: 0; }
.nwai-root .nwai-launcher:hover { transform: scale(1.05); filter: brightness(1.06); }
.nwai-root .nwai-launcher:focus-visible { outline: 3px solid var(--nwai-accent); outline-offset: 3px; }
.nwai-root .nwai-launcher svg { display: block; }
.nwai-root .nwai-ico-close { display: none; }
.nwai-root.nwai-open .nwai-ico-open { display: none; }
.nwai-root.nwai-open .nwai-ico-close { display: block; }

/* Okno chatu */
.nwai-root .nwai-panel {
  position: absolute;
  bottom: 76px;
  width: 380px;
  height: min(600px, calc(100vh - 120px));
  display: flex;
  flex-direction: column;
  background: var(--nwai-bg);
  border: 1px solid var(--nwai-border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 60px -18px rgba(17, 24, 39, 0.45), 0 4px 14px rgba(17, 24, 39, 0.08);
}
.nwai-root.nwai-pos-right .nwai-panel { right: 0; transform-origin: bottom right; }
.nwai-root.nwai-pos-left .nwai-panel { left: 0; transform-origin: bottom left; }

.nwai-root .nwai-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 14px 16px;
  background: var(--nwai-accent);
  color: var(--nwai-accent-text);
  flex: none;
}
.nwai-root .nwai-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.nwai-root .nwai-titles { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.nwai-root .nwai-title { font-size: 15.5px; font-weight: 650; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nwai-root .nwai-status { font-size: 12.5px; opacity: 0.88; display: flex; align-items: center; gap: 6px; }
.nwai-root .nwai-dot { width: 7px; height: 7px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35); flex: none; }
.nwai-root .nwai-close {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.nwai-root .nwai-close:hover { background: rgba(255, 255, 255, 0.18); }
.nwai-root .nwai-close:focus-visible { outline: 2px solid currentColor; outline-offset: -2px; }

/* Správy */
.nwai-root .nwai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.nwai-root .nwai-msg {
  max-width: 85%;
  padding: 10px 13px;
  border-radius: 16px;
  font-size: 14.5px;
  line-height: 1.5;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.nwai-root .nwai-assistant {
  align-self: flex-start;
  background: var(--nwai-surface);
  color: var(--nwai-text);
  border-bottom-left-radius: 5px;
}
.nwai-root .nwai-user {
  align-self: flex-end;
  background: var(--nwai-accent);
  color: var(--nwai-accent-text);
  border-bottom-right-radius: 5px;
  white-space: pre-wrap;
}
.nwai-root .nwai-msg a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.nwai-root .nwai-assistant a { color: var(--nwai-accent); font-weight: 600; filter: brightness(0.85); }
.nwai-root .nwai-msg strong { font-weight: 650; }
.nwai-root .nwai-error { background: #fef2f2; color: #991b1b; }
.nwai-root .nwai-retry {
  margin-top: 8px;
  padding: 5px 12px;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font-size: 13px;
}

.nwai-root .nwai-typing { display: inline-flex; gap: 4px; padding: 13px 14px; }
.nwai-root .nwai-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--nwai-muted); opacity: 0.55; }

/* Rýchle otázky */
.nwai-root .nwai-suggest { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 14px 10px; flex: none; }
.nwai-root .nwai-chip {
  padding: 7px 12px;
  border: 1px solid var(--nwai-accent);
  border-radius: 999px;
  background: var(--nwai-bg);
  color: var(--nwai-accent);
  font-size: 13.5px;
  font-weight: 550;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.nwai-root .nwai-chip:hover { background: var(--nwai-accent); color: var(--nwai-accent-text); }

/* Písanie */
.nwai-root .nwai-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--nwai-border);
  flex: none;
  background: var(--nwai-bg);
}
.nwai-root .nwai-input {
  flex: 1;
  resize: none;
  height: 42px;
  max-height: 120px;
  padding: 10px 13px;
  border: 1px solid var(--nwai-border);
  border-radius: 12px;
  background: var(--nwai-surface);
  color: var(--nwai-text);
  font-size: 14.5px;
  outline: none;
  width: auto;
}
.nwai-root .nwai-input:focus { border-color: var(--nwai-accent); background: var(--nwai-bg); box-shadow: 0 0 0 3px color-mix(in srgb, var(--nwai-accent) 20%, transparent); }
.nwai-root .nwai-input::placeholder { color: var(--nwai-muted); opacity: 1; }
.nwai-root .nwai-send {
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: var(--nwai-accent);
  color: var(--nwai-accent-text);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.nwai-root .nwai-send:disabled { opacity: 0.5; cursor: default; }
.nwai-root .nwai-send:focus-visible { outline: 3px solid var(--nwai-accent); outline-offset: 2px; }

.nwai-root .nwai-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 0 14px 10px;
  font-size: 11.5px;
  color: var(--nwai-muted);
  background: var(--nwai-bg);
  flex: none;
}
.nwai-root .nwai-reset {
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: var(--nwai-muted);
  font-size: 11.5px;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.nwai-root .nwai-reset:hover { color: var(--nwai-text); }

/* Mobil */
@media (max-width: 480px) {
  .nwai-root { bottom: 14px; }
  .nwai-root.nwai-pos-right { right: 14px; }
  .nwai-root.nwai-pos-left { left: 14px; }
  .nwai-root .nwai-panel {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 86px;
    width: auto;
    height: calc(100vh - 110px);
    height: calc(100dvh - 110px);
  }
  .nwai-root .nwai-input { font-size: 16px; } /* iOS nezoomuje */
}

/* Animácie len ak ich používateľ nevypol */
@media (prefers-reduced-motion: no-preference) {
  .nwai-root.nwai-open .nwai-panel { animation: nwai-pop 0.2s ease-out; }
  .nwai-root .nwai-msg { animation: nwai-in 0.18s ease-out; }
  .nwai-root .nwai-typing span { animation: nwai-bounce 1.1s ease-in-out infinite; }
  .nwai-root .nwai-typing span:nth-child(2) { animation-delay: 0.15s; }
  .nwai-root .nwai-typing span:nth-child(3) { animation-delay: 0.3s; }
}
@keyframes nwai-pop { from { opacity: 0; transform: translateY(10px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes nwai-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes nwai-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: 0.45; } 30% { transform: translateY(-4px); opacity: 1; } }
