:root {
  --inquiz-ink: #14201f;
  --inquiz-muted: #66756f;
  --inquiz-surface: #ffffff;
  --inquiz-soft: #f5f7f5;
  --inquiz-border: #e5e9e6;
  --inquiz-accent: #e8385a;
  --inquiz-accent-dark: #c82148;
  --inquiz-green: #174d43;
  --inquiz-shadow: 0 24px 70px rgba(20, 32, 31, 0.2), 0 8px 24px rgba(20, 32, 31, 0.11);
}

.inquiz-chat,
.inquiz-chat * {
  box-sizing: border-box;
}

.inquiz-chat {
  position: fixed;
  right: 24px;
  bottom: 88px;
  z-index: 999999;
  color: var(--inquiz-ink);
  font-family: Outfit, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

.inquiz-chat--student {
  --inquiz-accent: #2d8472;
  --inquiz-accent-dark: #174d43;
}

.inquiz-chat button,
.inquiz-chat textarea {
  font: inherit;
}

.inquiz-chat__launcher {
  position: relative;
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  padding: 0;
  overflow: visible;
  color: #fff;
  background: linear-gradient(145deg, #f05270, var(--inquiz-accent-dark));
  border: 0;
  border-radius: 50%;
  box-shadow: 0 14px 36px rgba(232, 56, 90, 0.38);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.inquiz-chat--student .inquiz-chat__launcher {
  background: linear-gradient(145deg, #267b6c, var(--inquiz-green));
  box-shadow: 0 14px 36px rgba(23, 77, 67, 0.32);
}

.inquiz-chat__launcher:hover {
  transform: translateY(-2px) scale(1.025);
  box-shadow: 0 18px 42px rgba(232, 56, 90, 0.43);
}

.inquiz-chat--student .inquiz-chat__launcher:hover {
  box-shadow: 0 18px 42px rgba(23, 77, 67, 0.4);
}

.inquiz-chat__launcher:focus-visible,
.inquiz-chat button:focus-visible,
.inquiz-chat textarea:focus-visible {
  outline: 3px solid rgba(232, 56, 90, 0.28);
  outline-offset: 3px;
}

.inquiz-chat--student .inquiz-chat__launcher:focus-visible,
.inquiz-chat--student button:focus-visible,
.inquiz-chat--student textarea:focus-visible {
  outline-color: rgba(45, 132, 114, 0.3);
}

.inquiz-chat__launcher-ring {
  position: absolute;
  inset: -6px;
  z-index: -1;
  border: 1px solid rgba(232, 56, 90, 0.22);
  border-radius: inherit;
  animation: inquiz-pulse 2.6s ease-out infinite;
}

.inquiz-chat__launcher svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.inquiz-chat__launcher-chat circle {
  fill: currentColor;
  stroke: none;
}

.inquiz-chat__launcher-close {
  display: none;
}

.inquiz-chat.is-open .inquiz-chat__launcher-chat {
  display: none;
}

.inquiz-chat.is-open .inquiz-chat__launcher-close {
  display: block;
}

.inquiz-chat__unread {
  position: absolute;
  top: -4px;
  right: -3px;
  display: grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  padding: 0 6px;
  color: var(--inquiz-accent-dark);
  font-size: 12px;
  font-weight: 700;
  background: #fff;
  border: 2px solid var(--inquiz-accent);
  border-radius: 999px;
}

.inquiz-chat__panel {
  position: absolute;
  right: 0;
  bottom: 78px;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  width: min(390px, calc(100vw - 32px));
  height: min(620px, calc(100vh - 120px));
  overflow: hidden;
  visibility: hidden;
  background: var(--inquiz-surface);
  border: 1px solid rgba(20, 32, 31, 0.08);
  border-radius: 24px;
  box-shadow: var(--inquiz-shadow);
  opacity: 0;
  transform: translateY(18px) scale(0.97);
  transform-origin: bottom right;
  transition: opacity 180ms ease, transform 220ms cubic-bezier(.2,.8,.2,1), visibility 180ms;
}

.inquiz-chat.is-open .inquiz-chat__panel {
  visibility: visible;
  opacity: 1;
  transform: translateY(0) scale(1);
}

.inquiz-chat__header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 86px;
  padding: 18px 18px 17px 20px;
  color: #fff;
  background:
    radial-gradient(circle at 90% 0, rgba(255,255,255,.14), transparent 38%),
    linear-gradient(125deg, #14201f, #214c44);
}

.inquiz-chat--sales .inquiz-chat__header {
  background:
    radial-gradient(circle at 90% 0, rgba(232,56,90,.28), transparent 38%),
    linear-gradient(125deg, #14201f, #273f3b);
}

.inquiz-chat__identity,
.inquiz-chat__name-row {
  display: flex;
  align-items: center;
}

.inquiz-chat__identity {
  gap: 12px;
}

.inquiz-chat__name-row {
  gap: 8px;
}

.inquiz-chat__avatar {
  position: relative;
  display: grid;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  place-items: center;
  color: #fff;
  font-family: Fraunces, Georgia, serif;
  font-size: 23px;
  font-weight: 600;
  background: linear-gradient(145deg, #f05d78, #d72d50);
  border: 2px solid rgba(255,255,255,.65);
  border-radius: 16px;
  box-shadow: 0 7px 20px rgba(0,0,0,.18);
}

.inquiz-chat--student .inquiz-chat__avatar {
  background: linear-gradient(145deg, #63b5a2, #25806e);
}

.inquiz-chat__avatar i {
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 13px;
  height: 13px;
  background: #5ee49b;
  border: 3px solid #23463f;
  border-radius: 50%;
}

.inquiz-chat__header h2 {
  margin: 0;
  color: inherit;
  font-family: Fraunces, Georgia, serif;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1.15;
}

.inquiz-chat__header p {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0 0;
  color: rgba(255,255,255,.72);
  font-size: 12.5px;
}

.inquiz-chat__online-dot {
  width: 6px;
  height: 6px;
  background: #5ee49b;
  border-radius: 50%;
}

.inquiz-chat__demo-badge {
  padding: 2px 7px;
  color: rgba(255,255,255,.82);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
}

.inquiz-chat__header-close {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  padding: 0;
  color: rgba(255,255,255,.8);
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 50%;
  cursor: pointer;
}

.inquiz-chat__header-close:hover {
  color: #fff;
  background: rgba(255,255,255,.15);
}

.inquiz-chat__header-close svg,
.inquiz-chat__composer svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.inquiz-chat__body {
  min-height: 0;
  padding: 16px 16px 12px;
  overflow-x: hidden;
  overflow-y: auto;
  background:
    linear-gradient(rgba(255,255,255,.91), rgba(255,255,255,.91)),
    radial-gradient(circle at 20% 20%, rgba(232,56,90,.1), transparent 42%),
    #f8faf8;
  scrollbar-color: #cfd8d3 transparent;
  scrollbar-width: thin;
}

.inquiz-chat__day {
  margin: 0 0 14px;
  color: #95a09c;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .11em;
  text-align: center;
  text-transform: uppercase;
}

.inquiz-chat__messages {
  display: grid;
  gap: 14px;
}

.inquiz-chat__message {
  display: flex;
  gap: 8px;
  max-width: 89%;
  animation: inquiz-message-in 220ms ease both;
}

.inquiz-chat__message--user {
  justify-self: end;
}

.inquiz-chat__message--assistant {
  justify-self: start;
}

.inquiz-chat__mini-avatar {
  display: grid;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  place-items: center;
  margin-top: 2px;
  color: #fff;
  font-family: Fraunces, Georgia, serif;
  font-size: 13px;
  background: var(--inquiz-accent);
  border-radius: 9px;
}

.inquiz-chat--student .inquiz-chat__mini-avatar {
  background: #2d8472;
}

.inquiz-chat__bubble {
  padding: 11px 13px;
  color: #35423e;
  font-size: 13.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  background: #fff;
  border: 1px solid var(--inquiz-border);
  border-radius: 5px 16px 16px 16px;
  box-shadow: 0 4px 12px rgba(20,32,31,.055);
}

.inquiz-chat__bubble a {
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
}

.inquiz-chat__md-heading {
  display: block;
  margin: 2px 0 1px;
  color: #1f2d29;
  font-weight: 800;
}

.inquiz-chat__md-rule {
  height: 1px;
  margin: 7px 0;
  background: var(--inquiz-border);
  border: 0;
}

.inquiz-chat__md-list-item {
  display: grid;
  grid-template-columns: 19px minmax(0, 1fr);
  gap: 2px;
  margin: 2px 0;
}

.inquiz-chat__md-marker {
  color: var(--inquiz-accent);
  font-weight: 800;
}

.inquiz-chat__message--user .inquiz-chat__bubble {
  color: #fff;
  background: var(--inquiz-accent);
  border-color: var(--inquiz-accent);
  border-radius: 16px 5px 16px 16px;
}

.inquiz-chat--student .inquiz-chat__message--user .inquiz-chat__bubble {
  background: #2d8472;
  border-color: #2d8472;
}

.inquiz-chat__message time {
  display: block;
  margin-top: 4px;
  color: #a0aaa6;
  font-size: 9px;
}

.inquiz-chat__message--user time {
  text-align: right;
}

.inquiz-chat__quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 16px 0 3px 36px;
}

.inquiz-chat__quick-replies button {
  padding: 7px 10px;
  color: #8f2440;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.25;
  background: #fff;
  border: 1px solid rgba(232,56,90,.26);
  border-radius: 999px;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease, transform 150ms ease;
}

.inquiz-chat--student .inquiz-chat__quick-replies button {
  color: #226656;
  border-color: rgba(45,132,114,.3);
}

.inquiz-chat__quick-replies button:hover {
  color: #fff;
  background: var(--inquiz-accent);
  transform: translateY(-1px);
}

.inquiz-chat--student .inquiz-chat__quick-replies button:hover {
  background: #2d8472;
}

.inquiz-chat__typing {
  width: fit-content;
  margin: 14px 0 0 36px;
  padding: 11px 14px;
  background: #fff;
  border: 1px solid var(--inquiz-border);
  border-radius: 5px 16px 16px 16px;
  box-shadow: 0 4px 12px rgba(20,32,31,.055);
}

.inquiz-chat__typing span {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin: 0 1.5px;
  background: #8d9995;
  border-radius: 50%;
  animation: inquiz-typing 1.2s infinite ease-in-out;
}

.inquiz-chat__typing span:nth-child(2) { animation-delay: .14s; }
.inquiz-chat__typing span:nth-child(3) { animation-delay: .28s; }

.inquiz-chat__composer {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 12px 14px 10px;
  background: #fff;
  border-top: 1px solid var(--inquiz-border);
}

.inquiz-chat__composer textarea {
  display: block;
  flex: 1;
  min-width: 0;
  min-height: 42px;
  max-height: 112px;
  padding: 10px 12px;
  resize: none;
  color: var(--inquiz-ink);
  font-size: 13px;
  line-height: 1.45;
  background: var(--inquiz-soft);
  border: 1px solid transparent;
  border-radius: 14px;
  outline: none;
}

.inquiz-chat__composer textarea:focus {
  background: #fff;
  border-color: rgba(232,56,90,.35);
  box-shadow: 0 0 0 3px rgba(232,56,90,.08);
}

.inquiz-chat--student .inquiz-chat__composer textarea:focus {
  border-color: rgba(45,132,114,.42);
  box-shadow: 0 0 0 3px rgba(45,132,114,.1);
}

.inquiz-chat__composer textarea::placeholder {
  color: #929d99;
}

.inquiz-chat__composer button {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  padding: 0;
  color: #fff;
  background: var(--inquiz-accent);
  border: 0;
  border-radius: 13px;
  cursor: pointer;
  transition: opacity 150ms ease, transform 150ms ease;
}

.inquiz-chat--student .inquiz-chat__composer button {
  background: #2d8472;
}

.inquiz-chat__composer button:not(:disabled):hover {
  transform: translateY(-1px);
}

.inquiz-chat__composer button:disabled {
  cursor: default;
  opacity: .35;
}

.inquiz-chat__footer {
  padding: 0 14px 10px;
  color: #9aa4a0;
  font-size: 9px;
  letter-spacing: .01em;
  text-align: center;
  background: #fff;
}

.inquiz-chat__lead-slot {
  margin: 14px 0 4px 36px;
}

.inquiz-chat__lead-form {
  display: grid;
  gap: 9px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--inquiz-border);
  border-radius: 15px;
  box-shadow: 0 7px 20px rgba(20,32,31,.075);
}

.inquiz-chat__lead-heading {
  display: grid;
  gap: 2px;
  margin-bottom: 2px;
}

.inquiz-chat__lead-heading strong {
  color: var(--inquiz-ink);
  font-size: 13px;
}

.inquiz-chat__lead-heading span,
.inquiz-chat__lead-status {
  margin: 0;
  color: #7d8985;
  font-size: 10px;
}

.inquiz-chat__lead-form label {
  display: grid;
  gap: 3px;
  color: #596762;
  font-size: 10.5px;
  font-weight: 600;
}

.inquiz-chat__lead-form input,
.inquiz-chat__lead-form select,
.inquiz-chat__lead-form textarea {
  width: 100%;
  min-height: 35px;
  padding: 7px 9px;
  color: var(--inquiz-ink);
  font: inherit;
  font-size: 12px;
  font-weight: 400;
  background: #f8faf8;
  border: 1px solid #dce3df;
  border-radius: 9px;
  outline: none;
}

.inquiz-chat__lead-form input:focus,
.inquiz-chat__lead-form select:focus,
.inquiz-chat__lead-form textarea:focus {
  background: #fff;
  border-color: rgba(232,56,90,.45);
  box-shadow: 0 0 0 3px rgba(232,56,90,.08);
}

.inquiz-chat__lead-form .inquiz-chat__consent {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 9.5px;
  line-height: 1.35;
}

.inquiz-chat__lead-form .inquiz-chat__consent input {
  flex: 0 0 auto;
  width: 13px;
  min-height: 13px;
  margin: 1px 0 0;
}

.inquiz-chat__lead-form button {
  min-height: 36px;
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  background: var(--inquiz-accent);
  border: 0;
  border-radius: 9px;
  cursor: pointer;
}

.inquiz-chat__lead-form button:disabled { opacity: .55; cursor: wait; }
.inquiz-chat__lead-status.is-error { color: #b42342; }
.inquiz-chat__honeypot { position: absolute !important; left: -9999px !important; width: 1px !important; height: 1px !important; }

.inquiz-chat__lead-success {
  display: grid;
  gap: 4px;
  padding: 13px;
  color: #225f50;
  font-size: 11.5px;
  background: #e9f8f1;
  border-radius: 11px;
}

.inquiz-chat__message.is-error .inquiz-chat__bubble {
  color: #982643;
  background: #fff2f5;
  border-color: #f2c8d2;
}

.inquiz-chat .screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes inquiz-pulse {
  0% { transform: scale(.88); opacity: .75; }
  72%, 100% { transform: scale(1.22); opacity: 0; }
}

@keyframes inquiz-message-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes inquiz-typing {
  0%, 60%, 100% { transform: translateY(0); opacity: .45; }
  30% { transform: translateY(-4px); opacity: 1; }
}

@media (max-width: 520px) {
  .inquiz-chat {
    right: 16px;
    bottom: 76px;
  }

  .inquiz-chat__panel {
    position: fixed;
    inset: 12px 12px 88px;
    width: auto;
    height: auto;
    border-radius: 20px;
    transform-origin: bottom center;
  }

  .inquiz-chat__launcher {
    width: 58px;
    height: 58px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .inquiz-chat *,
  .inquiz-chat *::before,
  .inquiz-chat *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
