.trial-launcher {
  position: fixed;
  bottom: 22px;
  inset-inline-start: 22px;
  z-index: 998;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.4rem;
  border: 0;
  border-radius: 50px;
  background: linear-gradient(135deg, #162953, #1565c0);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  font-family: inherit;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(21, 101, 192, 0.35);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  animation: trial-pulse 2.6s ease-in-out infinite;
}

.trial-launcher:hover,
.trial-launcher:focus-visible {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(21, 101, 192, 0.45);
}

.trial-chat-open .trial-launcher {
  display: none;
}

@keyframes trial-pulse {
  0%, 100% { box-shadow: 0 8px 24px rgba(21, 101, 192, 0.35); }
  50% { box-shadow: 0 8px 32px rgba(27, 219, 242, 0.55); }
}

.btn-hero-try {
  background: linear-gradient(135deg, #162953, #1565c0);
  color: #fff;
  border: 0;
  border-radius: 50px;
  padding: 0.75rem 1.9rem;
  font-weight: 700;
  font-size: 1rem;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(21, 101, 192, 0.3);
  transition: transform 0.1s, box-shadow 0.2s;
}

.btn-hero-try:hover {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(27, 219, 242, 0.4);
}

.trial-chat {
  position: fixed;
  bottom: 22px;
  inset-inline-start: 22px;
  z-index: 1050;
  width: 400px;
  max-width: calc(100vw - 32px);
  height: min(640px, calc(100vh - 44px));
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
  overflow: hidden;
  font-family: inherit;
}

.trial-chat[hidden] {
  display: none;
}

.trial-chat__header {
  border-bottom: 3px solid #1bdbf2;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  background: linear-gradient(135deg, #162953, #1565c0);
  color: #fff;
}

.trial-chat__avatar {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
}

.trial-chat__heading {
  flex: 1;
  min-width: 0;
}

.trial-chat__title {
  font-weight: 700;
  font-size: 1.02rem;
}

.trial-chat__subtitle {
  font-size: 0.8rem;
  opacity: 0.88;
}

.trial-chat__close {
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 1.15rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
}

.trial-chat__close:hover {
  background: rgba(255, 255, 255, 0.15);
}

.trial-chat__body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.trial-msg {
  max-width: 88%;
  padding: 0.6rem 0.85rem;
  border-radius: 16px;
  font-size: 0.95rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.trial-msg--bot {
  align-self: flex-start;
  background: #fff;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  border-start-start-radius: 4px;
}

.trial-msg--user {
  align-self: flex-end;
  background: #1565c0;
  color: #fff;
  border-start-end-radius: 4px;
}

.trial-typing {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #64748b;
}

.trial-typing__dots {
  display: inline-flex;
  gap: 3px;
}

.trial-typing__dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #94a3b8;
  animation: trial-blink 1.2s infinite ease-in-out;
}

.trial-typing__dots i:nth-child(2) { animation-delay: 0.15s; }
.trial-typing__dots i:nth-child(3) { animation-delay: 0.3s; }

@keyframes trial-blink {
  0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

.trial-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.trial-chip {
  border: 1.5px solid #1565c0;
  background: #fff;
  color: #1565c0;
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-align: start;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: background 0.15s, color 0.15s;
}

.trial-chip:hover:not(:disabled) {
  background: #eff6ff;
}

.trial-chip.is-picked {
  background: #1565c0;
  color: #fff;
}

.trial-chip--locked {
  border-style: dashed;
}

.trial-chip--locked .fa-lock {
  font-size: 0.72rem;
  opacity: 0.75;
}

.trial-choices.is-done {
  display: none;
}

.trial-exam {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.trial-exam__title {
  font-weight: 700;
  font-size: 1rem;
  color: #0f172a;
  text-align: center;
  border-bottom: 2px solid #0f172a;
  padding-bottom: 0.4rem;
}

.trial-exam__meta {
  font-size: 0.8rem;
  color: #64748b;
  text-align: center;
}

.trial-exam__more {
  text-align: center;
  color: #64748b;
  font-weight: 700;
}

.trial-question {
  border-top: 1px dashed #e2e8f0;
  padding-top: 0.55rem;
  animation: trial-rise 0.35s ease-out;
}

.trial-question__type {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  color: #0d47a1;
  background: #e0f7fb;
  border-radius: 6px;
  padding: 0.1rem 0.45rem;
  margin-bottom: 0.3rem;
}

.trial-question__passage {
  font-size: 0.85rem;
  color: #475569;
  background: #f8fafc;
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  margin-bottom: 0.3rem;
  max-height: 6.5em;
  overflow: hidden;
}

.trial-question__text {
  font-weight: 600;
  color: #0f172a;
  line-height: 1.6;
}

.trial-question__choices {
  margin: 0.3rem 0 0;
  padding-inline-start: 1.4rem;
  color: #334155;
  font-size: 0.9rem;
}

@keyframes trial-rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.trial-download {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: #16a34a;
  color: #fff;
  border-radius: 12px;
  padding: 0.75rem 1rem;
  font-weight: 700;
  text-decoration: none;
}

.trial-download:hover {
  background: #15803d;
  color: #fff;
}

.trial-footnote {
  font-size: 0.75rem;
  color: #94a3b8;
  text-align: center;
}

.trial-locked {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.trial-locked__title {
  font-weight: 700;
  color: #0f172a;
  font-size: 0.9rem;
}

.trial-locked__item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #94a3b8;
  border-radius: 10px;
  padding: 0.5rem 0.7rem;
  font-family: inherit;
  font-size: 0.88rem;
  text-align: start;
  cursor: pointer;
}

.trial-locked__item span {
  color: #64748b;
}

.trial-locked__item span {
  flex: 1;
}

.trial-locked__tier {
  font-style: normal;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 6px;
  padding: 0.1rem 0.4rem;
  white-space: nowrap;
}

.trial-locked__tier--free {
  color: #15803d;
  background: #f0fdf4;
}

.trial-locked__tier--paid {
  color: #0d47a1;
  background: #e0f7fb;
}

.trial-locked__item:hover {
  border-color: #0d47a1;
}

.trial-cta {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.trial-cta__button {
  border: 0;
  border-radius: 12px;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, #162953, #1565c0);
  color: #fff;
  font-weight: 700;
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
}

.trial-cta__note {
  font-size: 0.78rem;
  color: #64748b;
  text-align: center;
}

.trial-chat__input {
  display: flex;
  gap: 0.5rem;
  padding: 0.65rem;
  border-top: 1px solid #e2e8f0;
  background: #fff;
}

.trial-chat__field {
  flex: 1;
  min-width: 0;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 0.55rem 0.95rem;
  font-family: inherit;
  font-size: 0.95rem;
}

.trial-chat__field:focus {
  outline: none;
  border-color: #1565c0;
  box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.15);
}

.trial-chat__send {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border: 0;
  border-radius: 50%;
  background: #1565c0;
  color: #fff;
  cursor: pointer;
}

[dir="rtl"] .trial-chat__send .fa-paper-plane {
  transform: scaleX(-1);
}

.trial-chat__honeypot {
  position: absolute;
  inset-inline-start: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

@media (max-width: 575.98px) {
  .trial-launcher {
    bottom: 18px;
    inset-inline-start: 16px;
    padding: 0.7rem 1.1rem;
  }

  .trial-chat {
    inset: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
    border-radius: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .trial-launcher,
  .trial-question,
  .trial-typing__dots i {
    animation: none;
  }
}
