.gba-ai-assistant {
  --gba-ai-primary: #173a64;
  --gba-ai-primary-dark: #102947;
  --gba-ai-primary-mid: #2a5d94;
  --gba-ai-primary-soft: #e7eef7;
  --gba-ai-primary-softer: #f4f8fc;
  --gba-ai-border: rgba(23, 58, 100, 0.14);
  --gba-ai-text: #11243b;
  --gba-ai-muted: #63758c;
  --gba-ai-shadow: 0 26px 68px rgba(10, 28, 49, 0.2);
  position: fixed;
  right: 20px;
  bottom: 50px;
  z-index: 9998;
}

.gba-ai-assistant__launcher {
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
  transition: transform 0.2s ease;
}

.gba-ai-assistant__launcher-core {
  width: 50px;
  height: 50px;
  padding: 14px 12px 16px;
  border-radius: 50%;
  background: var(--gba-ai-primary);
  box-shadow: 0 20px 42px rgba(23, 58, 100, 0.28);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  position: relative;
  overflow: hidden;
}

.gba-ai-assistant__launcher-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.gba-ai-assistant__launcher-label {
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.01em;
  color: #fff;
  text-transform: uppercase;
}

.gba-ai-assistant__launcher-note {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.2;
}

.gba-ai-assistant__launcher-icon {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: static;
  flex: 0 0 auto;
}

.gba-ai-assistant__launcher-icon img {
  position: static;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.gba-ai-assistant__panel {
  width: min(430px, calc(100vw - 24px));
  height: min(600px, calc(100vh - 24px));
  background: #fff;
  border: 1px solid var(--gba-ai-border);
  border-radius: 30px;
  box-shadow: var(--gba-ai-shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.gba-ai-assistant__panel.is-expanded {
  width: min(760px, calc(100vw - 24px));
  height: min(840px, calc(100vh - 130px));
}

.gba-ai-assistant__header {
  position: relative;
  background: var(--gba-ai-primary);
  color: #fff;
  padding: 20px 20px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.gba-ai-assistant__heading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.gba-ai-assistant__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.gba-ai-assistant__heading h2 {
  margin: 0;
  font-size: 18px !important;
  line-height: 1.12;
  font-weight: 800;
  color: inherit;
}

.gba-ai-assistant__heading p {
  margin: 0;
  max-width: 30ch;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.88);
}

.gba-ai-assistant__header-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.gba-ai-assistant__icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 1.05rem;
  transition: background 0.2s ease, transform 0.2s ease;
}

.gba-ai-assistant__messages-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  background:
    radial-gradient(circle at top left, rgba(23, 58, 100, 0.08), transparent 30%),
    radial-gradient(circle at bottom right, rgba(42, 93, 148, 0.08), transparent 28%),
    linear-gradient(180deg, #f8fbff 0%, #f3f8fd 100%);
}

.gba-ai-assistant__messages {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px 14px 22px;
}

.gba-ai-assistant__messages-wrap::-webkit-scrollbar {
  display: none;
}

.gba-ai-assistant__date {
  align-self: center;
  padding: 6px 14px;
  border: 1px solid rgba(23, 58, 100, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--gba-ai-muted);
  font-size: 0.84rem;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(13, 32, 54, 0.04);
}

.gba-ai-assistant__row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.gba-ai-assistant__row--user {
  justify-content: flex-end;
}

.gba-ai-assistant__avatar {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 16px;
  background: var(--gba-ai-primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  position: relative;
  box-shadow: 0 14px 28px rgba(23, 58, 100, 0.18);
}

.gba-ai-assistant__avatar i {
  position: absolute;
  right: -4px;
  top: -4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  color: var(--gba-ai-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.55rem;
  box-shadow: 0 8px 18px rgba(13, 32, 54, 0.14);
}

.gba-ai-assistant__bubble-stack {
  max-width: min(82%, 560px);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gba-ai-assistant__meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px;
  color: var(--gba-ai-muted);
  font-size: 0.8rem;
  line-height: 1.2;
}

.gba-ai-assistant__meta-sender {
  font-weight: 700;
  color: var(--gba-ai-text);
}

.gba-ai-assistant__meta-time {
  color: var(--gba-ai-muted);
}

.gba-ai-assistant__row--user .gba-ai-assistant__bubble-stack {
  align-items: flex-end;
}

.gba-ai-assistant__row--user .gba-ai-assistant__meta {
  justify-content: flex-end;
}

.gba-ai-assistant__row--user .gba-ai-assistant__meta-sender,
.gba-ai-assistant__row--user .gba-ai-assistant__meta-time {
  color: rgba(17, 36, 59, 0.88);
}

.gba-ai-assistant__bubble {
  position: relative;
  width: 100%;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.6;
  word-break: break-word;
  box-shadow: 0 12px 28px rgba(13, 32, 54, 0.06);
  overflow: visible;
}

.gba-ai-assistant__bubble p {
  margin: 0;
}

.gba-ai-assistant__bubble--assistant {
  background: rgba(255, 255, 255, 0.96);
  color: var(--gba-ai-text);
  border: 1px solid rgba(23, 58, 100, 0.08);
  border-top-left-radius: 6px;
  border-bottom-left-radius: 4px;
}

.gba-ai-assistant__bubble--welcome {
  background:
    radial-gradient(circle at top right, rgba(42, 93, 148, 0.12), transparent 36%),
    linear-gradient(180deg, #ffffff 0%, var(--gba-ai-primary-softer) 100%);
}

.gba-ai-assistant__bubble--welcome::after {
  background:
    radial-gradient(circle at top right, rgba(42, 93, 148, 0.12), transparent 36%),
    linear-gradient(180deg, #ffffff 0%, var(--gba-ai-primary-softer) 100%);
}

.gba-ai-assistant__bubble--user {
  background: var(--gba-ai-primary);
  color: #fff;
  border-top-right-radius: 6px;
  border-bottom-right-radius: 4px;
}

.gba-ai-assistant__bubble--assistant::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 10px;
  width: 14px;
  height: 14px;
  background: #ffffff;
  clip-path: polygon(0 50%, 100% 0, 100% 100%);
  pointer-events: none;
}

.gba-ai-assistant__bubble--assistant::after {
  content: "";
  position: absolute;
  left: -8px;
  top: 10px;
  right: auto;
  width: 13px;
  height: 13px;
  transform: none;
  rotate: 0deg;
  background: #ffffff;
  clip-path: polygon(0 50%, 100% 0, 100% 100%);
  pointer-events: none;
}

.gba-ai-assistant__bubble--user::after {
  content: "";
  position: absolute;
  left: auto;
  right: -8px;
  top: 10px;
  width: 14px;
  height: 14px;
  transform: none;
  rotate: 0deg;
  background: var(--gba-ai-primary);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
  pointer-events: none;
}

.gba-ai-assistant__feedback,
.gba-ai-assistant__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
}

.gba-ai-assistant__feedback span {
  color: var(--gba-ai-muted);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 4px 2px;
}

.gba-ai-assistant__feedback-btn {
  --gba-ai-tag-bg: rgba(255, 255, 255, 0.88);
  --gba-ai-tag-color: var(--gba-ai-text);
}

.gba-ai-assistant__chip {
  --gba-ai-tag-bg: var(--gba-ai-primary-soft);
  --gba-ai-tag-color: var(--gba-ai-primary);
}

:is(.gba-ai-assistant__feedback-btn, .gba-ai-assistant__chip) {
  border: 1px solid var(--gba-ai-border);
  color: var(--gba-ai-tag-color);
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--gba-ai-tag-bg);
  font-weight: 600;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

:is(.gba-ai-assistant__feedback-btn, .gba-ai-assistant__chip):hover,
:is(.gba-ai-assistant__feedback-btn, .gba-ai-assistant__chip):focus-visible {
  transform: translateY(-1px);
  border-color: rgba(23, 58, 100, 0.3);
}

.gba-ai-assistant__products {
  display: grid;
  gap: 10px;
}

.gba-ai-assistant__articles {
  display: grid;
  gap: 10px;
}

.gba-ai-assistant__card {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(23, 58, 100, 0.1);
  color: inherit;
  text-decoration: none;
  box-shadow: 0 12px 24px rgba(13, 32, 54, 0.05);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.gba-ai-assistant__article-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(23, 58, 100, 0.1);
  color: inherit;
  text-decoration: none;
  box-shadow: 0 12px 24px rgba(13, 32, 54, 0.05);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.gba-ai-assistant__card:hover,
.gba-ai-assistant__card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(23, 58, 100, 0.24);
  box-shadow: 0 16px 30px rgba(13, 32, 54, 0.1);
}

.gba-ai-assistant__article-card:hover,
.gba-ai-assistant__article-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(23, 58, 100, 0.24);
  box-shadow: 0 16px 30px rgba(13, 32, 54, 0.1);
}

.gba-ai-assistant__card img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.gba-ai-assistant__article-card img {
  width: 72px;
  object-fit: contain;
  border-radius: 4px;
}

.gba-ai-assistant__card-copy > *,
.gba-ai-assistant__article-copy > * {
  display: block;
}

.gba-ai-assistant__card-copy strong {
  color: var(--gba-ai-text);
  font-size: 0.98rem;
  line-height: 1.35;
}

.gba-ai-assistant__article-copy strong {
  color: var(--gba-ai-text);
  font-size: 0.95rem;
  line-height: 1.4;
}

.gba-ai-assistant__card-copy span {
  margin-top: 2px;
  color: var(--gba-ai-primary);
  font-weight: 700;
}

.gba-ai-assistant__article-copy span {
  margin-top: 4px;
  color: var(--gba-ai-primary);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.35;
}

.gba-ai-assistant__card-copy small {
  margin-top: 4px;
  color: var(--gba-ai-muted);
  line-height: 1.45;
}

.gba-ai-assistant__article-copy small {
  margin-top: 4px;
  color: var(--gba-ai-muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.gba-ai-assistant__typing {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.gba-ai-assistant__typing span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gba-ai-primary-mid);
  animation: gbaAiTyping 0.9s ease-in-out infinite;
}

.gba-ai-assistant__typing span:nth-child(2) {
  animation-delay: 0.12s;
}

.gba-ai-assistant__typing span:nth-child(3) {
  animation-delay: 0.24s;
}

@keyframes gbaAiTyping {
  0%,
  80%,
  100% {
    transform: scale(0.7);
    opacity: 0.45;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

.gba-ai-assistant__composer {
  padding: 14px;
  border-top: 1px solid rgba(23, 58, 100, 0.08);
  background: linear-gradient(180deg, #fff 0%, var(--gba-ai-primary-softer) 100%);
}

.gba-ai-assistant__composer-shell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gba-ai-assistant__input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 24px;
  max-height: 120px;
  border: 0;
  resize: none;
  font-size: 1rem;
  line-height: 1.5;
  padding: 6px 8px;
  color: var(--gba-ai-text);
  background: transparent;
}

.gba-ai-assistant__input::placeholder {
  color: #7a8ca4;
}

.gba-ai-assistant__input:focus {
  outline: none;
}

.gba-ai-assistant__send {
  padding: 0 16px;
  border-radius: 16px;
  border: 0;
  color: var(--gba-ai-primary);
  background: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.gba-ai-assistant__send:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.gba-ai-assistant__composer-hint {
  margin: 10px 6px 0;
  color: var(--gba-ai-muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

@media (max-width: 767.98px) {
  .gba-ai-assistant {
    right: 12px;
  }

  .gba-ai-assistant__launcher-core {
    width: 50px;
    height: 50px;
    padding: 12px 10px 14px;
  }

  .gba-ai-assistant__launcher-icon {
    width: 30px;
    height: 30px;
  }

  .gba-ai-assistant__launcher-label {
    font-size: 18px;
  }

  .gba-ai-assistant__panel,
  .gba-ai-assistant__panel.is-expanded {
    width: min(95vw - 12px, 430px);
    height: min(75vh, 720px);
    border-radius: 24px;
  }

  .gba-ai-assistant__header {
    padding: 18px 16px 16px;
  }

  .gba-ai-assistant__heading h2 {
    font-size: 1.4rem;
  }

  .gba-ai-assistant__heading p {
    max-width: none;
    font-size: 0.92rem;
  }

  .gba-ai-assistant__messages {
    padding: 16px 12px 18px;
  }

  .gba-ai-assistant__bubble-stack {
    max-width: 100%;
  }

  .gba-ai-assistant__send span {
    display: none;
  }

  .gba-ai-assistant__send {
    min-width: 48px;
    width: 48px;
    padding: 0;
  }
}
