/* ==========================================================================
   bot.css — Pixie / ProntoCore
   Design: Deep navy glassmorphism · Refined spacing · Subtle kinetics
   ========================================================================== */

/* ─────────────────────────────────────────────────────────────────────────────
   DESIGN TOKENS
   ───────────────────────────────────────────────────────────────────────── */
#pixie-root {
  /* Canvas – deep midnight navy */
  --px-ink-0:      #020510;
  --px-ink-1:      #060c1c;
  --px-ink-2:      #0b1226;
  --px-ink-3:      #111b35;
  --px-ink-4:      #182140;

  /* Blue spectrum */
  --px-blue-dim:   #142f6b;
  --px-blue:       #3568e8;
  --px-blue-mid:   #5a8fff;
  --px-blue-hi:    #8ab4ff;

  /* Accents */
  --px-violet:     #6030d8;
  --px-cyan:       #00c0d8;
  --px-green:      #1fce6b;

  /* Text */
  --px-text-hi:    #e8eeff;
  --px-text-md:    #8ea8cc;
  --px-text-lo:    #435878;

  /* Borders */
  --px-line:       rgba(80, 130, 255, 0.11);
  --px-line-hi:    rgba(80, 130, 255, 0.26);
  --px-line-soft:  rgba(255, 255, 255, 0.04);

  /* Glow */
  --px-glow-a:     rgba(53, 104, 232, 0.28);
  --px-glow-b:     rgba(96, 48, 216, 0.18);
  --px-glow-cyan:  rgba(0, 192, 216, 0.14);

  /* Bubbles */
  --px-user-start: #12276a;
  --px-user-end:   #3568e8;
  --px-bot-fill:   #0d1630;

  /* Geometry */
  --px-r:          18px;
  --px-r-sm:       11px;
  --px-r-xs:       7px;

  /* Sizing */
  --px-win-w:      376px;
  --px-win-h:      568px;
  --px-z:          9999;

  /* Motion */
  --px-ease:       cubic-bezier(0.4, 0, 0.2, 1);
  --px-spring:     cubic-bezier(0.34, 1.56, 0.64, 1);
  --px-snap:       cubic-bezier(0.22, 1, 0.36, 1);
  --px-t:          0.20s;

  /* Typography */
  --px-font: 'Inter', 'SF Pro Text', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ─────────────────────────────────────────────────────────────────────────────
   ANIMATIONS — zdefiniowane razem z JS-inlined styles, tutaj jako kanon
   ───────────────────────────────────────────────────────────────────────── */
@keyframes pixie-orbit {
  to { transform: rotate(360deg); }
}

@keyframes pixie-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.82); }
}

@keyframes pixie-reveal {
  from {
    opacity: 0;
    transform: scale(0.90) translateY(18px);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0);
  }
}

@keyframes pixie-msg-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes pixie-bounce {
  0%, 70%, 100% {
    transform: translateY(0);
    opacity: 0.35;
    box-shadow: none;
  }
  35% {
    transform: translateY(-6px);
    opacity: 1;
    box-shadow: 0 0 9px var(--px-blue);
  }
}

@keyframes pixiePopIn {
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes pixieRobotFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%       { transform: translateY(-5px) rotate(2deg); }
}

@keyframes pixieLauncherPulse {
  0%, 100% {
    transform: translateY(0) scale(1);
    box-shadow:
      0 8px 24px rgba(0, 0, 0, 0.18),
      0 0 0 0 rgba(80, 130, 255, 0.4);
  }
  50% {
    transform: translateY(-5px) scale(1.02);
    box-shadow:
      0 14px 32px rgba(0, 0, 0, 0.24),
      0 0 0 6px rgba(80, 130, 255, 0);
  }
}

@keyframes pixieWave {
  0%, 100% { transform: translateY(0); opacity: 0.3; }
  35%       { transform: translateY(-5px); opacity: 1; filter: blur(0.1px); }
  70%       { transform: translateY(0.5px); opacity: 0.3; }
}

@keyframes pixieMsgReveal {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─────────────────────────────────────────────────────────────────────────────
   CONTAINER
   ───────────────────────────────────────────────────────────────────────── */
#pixie-root {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: var(--px-z);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
  font-family: var(--px-font);
  isolation: isolate;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─────────────────────────────────────────────────────────────────────────────
   HINT BUBBLE
   ───────────────────────────────────────────────────────────────────────── */
.pixie-hint-bubble {
  position: absolute;
  bottom: 82px;
  right: 5px;
  background: var(--px-ink-2);
  border: 1px solid var(--px-line-hi);
  color: var(--px-text-hi);
  padding: 10px 16px;
  border-radius: 16px 16px 4px 16px;
  font-size: 13px;
  font-family: var(--px-font);
  white-space: nowrap;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  opacity: 0;
  transform: translateY(12px) scale(0.95);
  animation: pixiePopIn 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  animation-delay: 10s;
  z-index: 999999;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* ─────────────────────────────────────────────────────────────────────────────
   LAUNCHER BUTTON
   ───────────────────────────────────────────────────────────────────────── */
#pixie-launcher {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--px-text-hi);
  flex-shrink: 0;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  border: none;
  background: none;
  padding: 0;
  transition:
    transform var(--px-t) var(--px-spring),
    filter var(--px-t) var(--px-ease);
}

/* Launcher nie-otwarty – floating pulse */
#pixie-launcher:not(.pixie-launcher--open) {
  animation: pixieLauncherPulse 4s ease-in-out infinite;
}

/* Avatar float */
#pixie-launcher:not(.pixie-launcher--open) .pixie-launcher-avatar {
  animation: pixieRobotFloat 3s ease-in-out infinite;
}

/* Glass disc */
#pixie-launcher::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(
    145deg,
    #141e3a 0%,
    #060c1c 100%
  );
  border: 1px solid var(--px-line-hi);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.32),
    0 8px 30px rgba(0, 0, 0, 0.58),
    0 0 24px var(--px-glow-a),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition:
    box-shadow var(--px-t) var(--px-ease),
    border-color var(--px-t) var(--px-ease);
  z-index: 0;
}

/* Conic ring */
#pixie-launcher::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    var(--px-blue)   0deg,
    var(--px-cyan)   90deg,
    var(--px-violet) 180deg,
    transparent      210deg,
    transparent      330deg,
    var(--px-blue)   360deg
  );
  opacity: 0;
  animation: pixie-orbit 4s linear infinite;
  transition: opacity 0.35s var(--px-ease);
  z-index: -1;
  mask: radial-gradient(circle at center, transparent 44%, black 47%);
  -webkit-mask: radial-gradient(circle at center, transparent 44%, black 47%);
}

#pixie-launcher:hover::before,
#pixie-launcher.pixie-launcher--open::before {
  opacity: 1;
}

#pixie-launcher:hover::after,
#pixie-launcher.pixie-launcher--open::after {
  border-color: rgba(80, 130, 255, 0.32);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.32),
    0 12px 38px rgba(0, 0, 0, 0.68),
    0 0 38px var(--px-glow-a),
    0 0 60px var(--px-glow-b),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

#pixie-launcher:hover {
  transform: scale(1.06);
  animation: none;
}

#pixie-launcher.pixie-launcher--open {
  transform: scale(1.04);
  animation: none;
}

#pixie-launcher:active {
  transform: scale(0.94);
}

#pixie-launcher:focus-visible::after {
  box-shadow:
    0 0 0 3px var(--px-ink-1),
    0 0 0 5px var(--px-blue);
}

/* ─────────────────────────────────────────────────────────────────────────────
   LAUNCHER ICONS (chat / close toggle)
   ───────────────────────────────────────────────────────────────────────── */
.pixie-icon {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  transition:
    opacity 0.32s var(--px-ease),
    transform 0.42s var(--px-spring);
  pointer-events: none;
}

.pixie-icon svg {
  width: 22px;
  height: 22px;
  stroke-width: 1.8px;
  filter: drop-shadow(0 0 5px rgba(80, 130, 255, 0.5));
}

.pixie-launcher-avatar {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
  transition: transform 0.3s ease;
}

.pixie-icon--chat {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

.pixie-icon--close {
  opacity: 0;
  transform: scale(0.2) rotate(-120deg);
}

#pixie-launcher.pixie-launcher--open .pixie-icon--chat {
  opacity: 0;
  transform: scale(0.2) rotate(120deg);
}

#pixie-launcher.pixie-launcher--open .pixie-icon--close {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}
/* ─────────────────────────────────────────────
   RESPONSYWNE ZAMYKANIE (Etap 2)
   PC      → zamykanie przez X launchera, strzałka w nagłówku ukryta
   Tablet  → zamykanie przez strzałkę w nagłówku, launcher ukryty gdy otwarty
   Telefon → zamykanie przez strzałkę w nagłówku (minimalizm)
   ───────────────────────────────────────────── */

/* PC: ukryj strzałkę w dół w nagłówku */
@media (min-width: 1025px) {
  #pixie-close {
    display: none;
  }
}

/* Tablet + telefon: ukryj launcher gdy chat jest otwarty
   (zostaje strzałka w nagłówku jako jedyny sposób zamknięcia) */
@media (max-width: 1024px) {
  #pixie-launcher.pixie-launcher--open {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
  }
}

/* ─────────────────────────────────────────────────────────────────────────────
   NOTIFICATION BADGE
   ───────────────────────────────────────────────────────────────────────── */
.pixie-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--px-blue), var(--px-violet));
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  font-family: var(--px-font);
  line-height: 20px;
  text-align: center;
  border: 2px solid var(--px-ink-1);
  opacity: 0;
  transform: scale(0.4) translateY(4px);
  pointer-events: none;
  transition:
    opacity 0.22s var(--px-ease),
    transform 0.38s var(--px-spring);
  z-index: 2;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 8px rgba(53, 104, 232, 0.4);
}

.pixie-badge--visible {
  opacity: 1;
  transform: scale(1) translateY(0);
}

/* ─────────────────────────────────────────────────────────────────────────────
   CHAT WINDOW
   ───────────────────────────────────────────────────────────────────────── */
#pixie-window {
  width: var(--px-win-w);
  height: var(--px-win-h);
  border-radius: var(--px-r);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform-origin: bottom right;
  animation: pixie-reveal 0.40s var(--px-snap) both;
  position: relative;

  background:
    linear-gradient(
      180deg,
      rgba(18, 28, 54, 0.12) 0px,
      transparent 52px
    ),
    var(--px-ink-0);
  border: 1px solid var(--px-line-hi);

  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.40),
    0 24px 60px rgba(0, 0, 0, 0.62);
}

/* Top shimmer line */
#pixie-window::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(80, 130, 255, 0.55) 35%,
    rgba(0, 192, 216, 0.65) 60%,
    rgba(96, 48, 216, 0.45) 80%,
    transparent 100%
  );
  z-index: 10;
  pointer-events: none;
}

/* Subtle dot-grid texture */
#pixie-window::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(80, 130, 255, 0.045) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
  z-index: 0;
  border-radius: inherit;
}

#pixie-window.pixie-hidden {
  display: none !important;
}

/* ─────────────────────────────────────────────────────────────────────────────
   HEADER
   ───────────────────────────────────────────────────────────────────────── */
.pixie-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 15px;
  border-bottom: 1px solid var(--px-line);
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  background: linear-gradient(
    90deg,
    #0d1428 0%,
    #090e1e 100%
  );
}

.pixie-header__info {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Avatar container */
.pixie-avatar {
  position: relative;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
}

.pixie-avatar svg {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: block;
}

/* Spinning gradient ring */
.pixie-avatar::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: conic-gradient(
    var(--px-blue)   0deg,
    var(--px-cyan)   120deg,
    var(--px-violet) 240deg,
    var(--px-blue)   360deg
  );
  animation: pixie-orbit 5s linear infinite;
  z-index: -1;
  opacity: 0.65;
}

/* Presence dot */
.pixie-avatar::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--px-green);
  border: 2px solid var(--px-ink-2);
  box-shadow: 0 0 8px rgba(31, 206, 107, 0.65);
  animation: pixie-pulse 2.8s ease infinite;
}

.pixie-header__name {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--px-text-hi);
  letter-spacing: 0.01em;
  line-height: 1;
}

.pixie-header__sub {
  display: block;
  font-size: 10.5px;
  color: var(--px-text-md);
  margin-top: 3px;
  letter-spacing: 0.02em;
}

/* ─────────────────────────────────────────────────────────────────────────────
   HEADER ACTION BUTTONS (export / clear / close)
   ───────────────────────────────────────────────────────────────────────── */
.pixie-header__actions {
  display: flex;
  align-items: center;
  gap: 3px;
}

.pixie-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--px-text-md);
  opacity: 0.65;
  cursor: pointer;
  border-radius: var(--px-r-xs);
  transition:
    opacity 0.18s var(--px-ease),
    background 0.18s var(--px-ease),
    border-color 0.18s var(--px-ease),
    color 0.18s var(--px-ease),
    transform 0.18s var(--px-ease);
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.pixie-icon-btn:hover {
  opacity: 1;
  color: var(--px-text-hi);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

.pixie-icon-btn:active {
  transform: scale(0.91);
  opacity: 0.8;
}

.pixie-icon-btn:focus-visible {
  box-shadow: 0 0 0 2px var(--px-ink-1), 0 0 0 4px var(--px-blue);
}

.pixie-icon-btn svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.9px;
  pointer-events: none;
}

/* Close chevron slightly larger */
.pixie-close-btn svg {
  width: 17px;
  height: 17px;
  stroke-width: 2.2px;
}

/* ─────────────────────────────────────────────────────────────────────────────
   MESSAGE AREA
   ───────────────────────────────────────────────────────────────────────── */
.pixie-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scroll-behavior: smooth;
  position: relative;
  z-index: 1;
}

/* Webkit scrollbar */
.pixie-messages::-webkit-scrollbar {
  width: 3px;
}
.pixie-messages::-webkit-scrollbar-track {
  background: transparent;
}
.pixie-messages::-webkit-scrollbar-thumb {
  background: rgba(53, 104, 232, 0.20);
  border-radius: 3px;
}
.pixie-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(53, 104, 232, 0.45);
}

/* Firefox */
.pixie-messages {
  scrollbar-width: thin;
  scrollbar-color: rgba(53, 104, 232, 0.20) transparent;
}

/* ─────────────────────────────────────────────────────────────────────────────
   MESSAGE ROWS
   ───────────────────────────────────────────────────────────────────────── */
.pixie-msg {
  display: flex;
  flex-direction: column;
  max-width: 84%;
  animation: pixie-msg-in 0.30s var(--px-snap) both;
}

.pixie-msg--bot {
  align-self: flex-start;
  align-items: flex-start;
}

.pixie-msg--user {
  align-self: flex-end;
  align-items: flex-end;
}

/* Optional sender label */
.pixie-msg__label {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--px-text-lo);
  padding: 0 6px 4px;
}

/* Timestamp */
.pixie-time {
  font-size: 10px;
  color: rgba(142, 168, 204, 0.45);
  padding: 3px 6px 0;
  letter-spacing: 0.02em;
}

/* ─────────────────────────────────────────────────────────────────────────────
   BUBBLES
   ───────────────────────────────────────────────────────────────────────── */
.pixie-bubble {
  padding: 10px 14px;
  font-size: 13.5px;
  line-height: 1.58;
  color: var(--px-text-hi);
  word-break: break-word;
  white-space: pre-wrap;
  position: relative;
}

/* Bot bubble */
.pixie-msg--bot .pixie-bubble {
  background: var(--px-bot-fill);
  border: 1px solid var(--px-line);
  border-radius: var(--px-r) var(--px-r) var(--px-r) 4px;
  box-shadow:
    0 2px 10px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* Inner shimmer top edge on bot bubble */
.pixie-msg--bot .pixie-bubble::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  border-radius: var(--px-r) var(--px-r) 0 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(80, 130, 255, 0.18) 40%,
    transparent
  );
  pointer-events: none;
}

/* User bubble */
.pixie-msg--user .pixie-bubble {
  background: linear-gradient(
    140deg,
    var(--px-user-start) 0%,
    var(--px-user-end)   100%
  );
  border: 1px solid rgba(80, 130, 255, 0.25);
  border-radius: var(--px-r) var(--px-r) 4px var(--px-r);
  color: #fff;
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.30),
    0 0 20px rgba(53, 104, 232, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.10);
}

/* ─────────────────────────────────────────────────────────────────────────────
   TYPING INDICATOR
   ───────────────────────────────────────────────────────────────────────── */
.pixie-msg--typing .pixie-bubble {
  padding: 6px 4px;
  background: transparent;
  border: none;
  box-shadow: none;
}
.pixie-msg--typing .pixie-bubble::before {
  display: none;
}

/* pixie-dots-wave (JS-rendered) */
.pixie-dots-wave {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 2px;
}

.pixie-dots-wave span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--px-blue-mid);
  box-shadow: 0 0 8px rgba(90, 143, 255, 0.55);
  opacity: 0.3;
  animation: pixieWave 1.3s ease-in-out infinite;
}

.pixie-dots-wave span:nth-child(1) { animation-delay: 0s; }
.pixie-dots-wave span:nth-child(2) { animation-delay: 0.2s; }
.pixie-dots-wave span:nth-child(3) { animation-delay: 0.4s; }

/* Legacy .pixie-dots (jeśli używane) */
.pixie-dots {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}

.pixie-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--px-blue-mid);
  display: block;
  animation: pixie-bounce 1.5s ease-in-out infinite;
}

.pixie-dots span:nth-child(1) { animation-delay: 0s; }
.pixie-dots span:nth-child(2) { animation-delay: 0.18s; }
.pixie-dots span:nth-child(3) { animation-delay: 0.36s; }

/* ─────────────────────────────────────────────────────────────────────────────
   MARKDOWN ELEMENTS IN BOT BUBBLES
   ───────────────────────────────────────────────────────────────────────── */
.pixie-bubble pre.pixie-code-block {
  background: rgba(0, 0, 0, 0.30);
  border: 1px solid rgba(80, 130, 255, 0.16);
  border-radius: var(--px-r-xs);
  padding: 9px 12px;
  overflow-x: auto;
  font-size: 12px;
  line-height: 1.55;
  margin: 7px 0;
  white-space: pre;
  font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Cascadia Code', monospace;
}

.pixie-bubble code.pixie-inline-code {
  background: rgba(80, 130, 255, 0.10);
  border: 1px solid rgba(80, 130, 255, 0.14);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.88em;
  font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', monospace;
  color: var(--px-blue-hi);
}

.pixie-bubble pre.pixie-code-block code {
  background: transparent;
  border: none;
  padding: 0;
  color: var(--px-text-hi);
}

/* ─────────────────────────────────────────────────────────────────────────────
   COPY BUTTON (pod wiadomością bota)
   ───────────────────────────────────────────────────────────────────────── */
.pixie-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 7px;
  border: none;
  background: transparent;
  color: var(--px-text-md);
  opacity: 0.45;
  font-size: 10.5px;
  font-family: var(--px-font);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: var(--px-r-xs);
  transition:
    opacity 0.18s var(--px-ease),
    color 0.18s var(--px-ease);
  outline: none;
}

.pixie-copy-btn:hover {
  opacity: 0.9;
  color: var(--px-text-hi);
}

.pixie-copy-btn svg {
  width: 12px;
  height: 12px;
}

.pixie-copy-btn--copied {
  opacity: 1;
  color: var(--px-blue-mid);
}

/* ─────────────────────────────────────────────────────────────────────────────
   DATE DIVIDER
   ───────────────────────────────────────────────────────────────────────── */
.pixie-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0 2px;
}

.pixie-divider::before,
.pixie-divider::after {
  content: '';
  flex: 1;
  height: 1px;
}

.pixie-divider::before {
  background: linear-gradient(90deg, transparent, rgba(53, 104, 232, 0.14));
}

.pixie-divider::after {
  background: linear-gradient(90deg, rgba(53, 104, 232, 0.14), transparent);
}

.pixie-divider span {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--px-text-lo);
  white-space: nowrap;
}

/* ─────────────────────────────────────────────────────────────────────────────
   ERROR STATE
   ───────────────────────────────────────────────────────────────────────── */
.pixie-msg--error .pixie-bubble {
  background: rgba(160, 30, 30, 0.12);
  border-color: rgba(220, 70, 70, 0.22);
  color: #f2a0a0;
}

/* ─────────────────────────────────────────────────────────────────────────────
   FOOTER / INPUT AREA
   ───────────────────────────────────────────────────────────────────────── */
.pixie-footer {
  display: flex;
  align-items: flex-end;
  gap: 9px;
  padding: 11px 13px;
  border-top: 1px solid var(--px-line);
  background: var(--px-ink-1);
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

/* Gradient separator accent */
.pixie-footer::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(53, 104, 232, 0.32) 28%,
    rgba(0, 192, 216, 0.38) 55%,
    rgba(96, 48, 216, 0.28) 80%,
    transparent 100%
  );
  pointer-events: none;
}

/* Textarea */
.pixie-input {
  flex: 1;
  background: rgba(18, 28, 54, 0.85);
  border: 1px solid rgba(53, 104, 232, 0.16);
  border-radius: var(--px-r-sm);
  color: var(--px-text-hi);
  font-family: var(--px-font);
  font-size: 13.5px;
  line-height: 1.52;
  padding: 9px 13px;
  resize: none;
  outline: none;
  min-height: 40px;
  max-height: 120px;
  field-sizing: content;
  transition:
    border-color var(--px-t) var(--px-ease),
    background var(--px-t) var(--px-ease),
    box-shadow var(--px-t) var(--px-ease);
}

.pixie-input::placeholder {
  color: rgba(142, 168, 204, 0.38);
}

.pixie-input:focus {
  border-color: rgba(53, 104, 232, 0.52);
  background: var(--px-ink-3);
  box-shadow:
    0 0 0 3px rgba(53, 104, 232, 0.10),
    inset 0 1px 3px rgba(0, 0, 0, 0.28);
}



.pixie-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Scrollbar w polu tekstowym — spójny z resztą chatu */
.pixie-input {
  scrollbar-width: thin;
  scrollbar-color: rgba(53, 104, 232, 0.30) transparent;
}
.pixie-input::-webkit-scrollbar {
  width: 6px;
}
.pixie-input::-webkit-scrollbar-track {
  background: transparent;
  margin: 6px 0;
}
.pixie-input::-webkit-scrollbar-thumb {
  background: rgba(53, 104, 232, 0.28);
  border-radius: 999px;
}
.pixie-input::-webkit-scrollbar-thumb:hover {
  background: rgba(53, 104, 232, 0.45);
}





/* Send button */
.pixie-send-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--px-r-sm);
  border: 1px solid rgba(53, 104, 232, 0.26);
  background: linear-gradient(140deg, #2158c8 0%, #3568e8 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    background var(--px-t) var(--px-ease),
    transform var(--px-t) var(--px-spring),
    box-shadow var(--px-t) var(--px-ease),
    border-color var(--px-t) var(--px-ease),
    opacity var(--px-t) var(--px-ease);
  box-shadow:
    0 4px 14px rgba(53, 104, 232, 0.30),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.pixie-send-btn svg {
  width: 16px;
  height: 16px;
  stroke-width: 2px;
  transform: translateX(1px);
}

.pixie-send-btn:hover:not(:disabled) {
  background: linear-gradient(140deg, #3568e8 0%, #6030d8 100%);
  border-color: rgba(96, 48, 216, 0.32);
  transform: translateY(-2px) scale(1.04);
  box-shadow:
    0 8px 24px rgba(53, 104, 232, 0.42),
    0 0 20px rgba(96, 48, 216, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.pixie-send-btn:active:not(:disabled) {
  transform: scale(0.91) translateY(0);
  box-shadow: 0 2px 8px rgba(53, 104, 232, 0.28);
}

.pixie-send-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.pixie-send-btn:focus-visible {
  box-shadow: 0 0 0 2px var(--px-ink-1), 0 0 0 4px var(--px-blue);
}

/* ─────────────────────────────────────────────────────────────────────────────
   RESPONSIVE — MOBILE (≤ 450px)
   ───────────────────────────────────────────────────────────────────────── */
@media (max-width: 450px) {
  #pixie-root {
    bottom: 0;
    right: 0;
    left: 0;
    padding: 0 0 18px;
    align-items: center;
  }

  #pixie-window {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    animation: pixie-reveal-mobile 0.3s var(--px-snap) both;
  }

  body.pixie-modal-open {
    overflow: hidden;
  }

  /* When chat is open the root must have no transform — any non-none transform
     creates a new containing block and hijacks position:fixed on #pixie-window */
  body.pixie-modal-open #pixie-root {
    transform: none;
    animation: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    padding: 0;
  }

  @keyframes pixie-reveal-mobile {
    from {
      opacity: 0;
      transform: translateY(28px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }

  .pixie-footer {
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }

  #pixie-launcher {
    position: fixed;
    bottom: 20px;
    right: 20px;
  }

  /* Hero-scroll hide/reveal */
  #pixie-root {
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition:
      opacity 0.4s ease,
      visibility 0.4s ease,
      transform 0.4s ease;
    pointer-events: none;
  }

  @supports (animation-timeline: scroll()) {
    @keyframes revealChatbotMobile {
      to {
        opacity: 1;
        visibility: visible;
        transform: none;
        pointer-events: auto;
      }
    }

    #pixie-root {
      animation: revealChatbotMobile linear both;
      animation-timeline: scroll(root);
      animation-range: 0px 80vh;
    }
  }

  @media not all and (animation-timeline: scroll()) {
    #pixie-root {
      animation: fallbackRevealMobile 0.5s ease 2s forwards;
    }

    @keyframes fallbackRevealMobile {
      to {
        opacity: 1;
        visibility: visible;
        transform: none;
        pointer-events: auto;
      }
    }
  }
}

/* ─────────────────────────────────────────────────────────────────────────────
   ACCESSIBILITY — REDUCED MOTION
   ───────────────────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  #pixie-window,
  .pixie-msg,
  #pixie-launcher::before,
  .pixie-avatar::before {
    animation: none !important;
  }

  .pixie-icon,
  .pixie-badge,
  .pixie-avatar::after,
  #pixie-launcher {
    animation: none !important;
    transition: none !important;
  }

  /* Typing dots intentionally keep animating: they signal live system status */

  .pixie-send-btn,
  .pixie-icon-btn,
  .pixie-input,
  .pixie-copy-btn {
    transition: none !important;
  }
}


/* Avatar (obrazek) w naglowku — JS renderuje <img class="pixie-avatar-img">,
   a arkusz mial tylko '.pixie-avatar svg'. Bez tej reguly <img> idzie w natywnym
   rozmiarze PNG. */
.pixie-avatar-img {
  position: relative;
  z-index: 1;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

/* Fallback "P" — pod obrazkiem; ujawnia sie tylko gdy avatar.png sie nie zaladuje */
.pixie-avatar-fallback {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--px-blue), var(--px-violet));
  color: #fff;
  font: 700 15px var(--px-font);
}