/* AI Academy / SOQ support widget — brand chrome, AI Assistant */
.soq-sw {
  --soq-sw-navy: #121F3E;
  --soq-sw-navy-mid: #1B2A4E;
  --soq-sw-navy-dark: #0A1224;
  --soq-sw-gold: #D4AF37;
  --soq-sw-gold-light: #FDE047;
  --soq-sw-gold-hover: #C59B27;
  --soq-sw-blue: #121F3E;
  --soq-sw-blue-mid: #1B2A4E;
  --soq-sw-blue-dark: #0A1224;
  --soq-sw-lime: #D4AF37;
  --soq-sw-lime-hover: #C59B27;
  --soq-sw-muted: #5A6A85;
  --soq-sw-border: #D8E0EC;
  --soq-sw-panel-bg: #F8FAFC;
  --soq-sw-bubble-in: #ffffff;
  --soq-sw-bubble-out: #121F3E;
  --soq-sw-surface: #F7F9FC;
  --soq-sw-z: 1040;
  --soq-sw-radius: 24px;
  font-family: "DM Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--soq-sw-navy);
  position: relative;
  z-index: var(--soq-sw-z);
}

.soq-sw__fab {
  position: fixed;
  right: 48px;
  bottom: 48px;
  width: 72px;
  height: 72px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  overflow: visible;
  isolation: isolate;
  z-index: calc(var(--soq-sw-z) + 2);
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.18s ease, box-shadow 0.18s ease;
}

.soq-sw__fab:hover {
  transform: scale(1.1) translateY(-2px);
}

.soq-sw__fab:active {
  transform: scale(0.96);
}

.soq-sw.is-open .soq-sw__fab {
  background: linear-gradient(145deg, var(--soq-sw-navy) 0%, var(--soq-sw-navy-mid) 100%);
  box-shadow:
    0 10px 24px rgba(18, 31, 62, 0.45),
    0 2px 6px rgba(18, 31, 62, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  border: 2px solid var(--soq-sw-gold);
}

/* Always-on AR targeting rings around the FAB */
.soq-sw__fab-fx {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.soq-sw__fab-ar {
  position: absolute;
  border-radius: 50%;
  box-sizing: border-box;
}

.soq-sw__fab-ar--outer {
  inset: -14px;
  border: 2px solid transparent;
  border-top-color: var(--soq-sw-gold);
  border-right-color: rgba(212, 175, 55, 0.35);
  border-bottom-color: rgba(18, 31, 62, 0.45);
  box-shadow:
    0 0 0 1px rgba(212, 175, 55, 0.2),
    0 0 14px rgba(212, 175, 55, 0.35),
    0 0 20px rgba(18, 31, 62, 0.25);
  animation: soqSwFabSpin 4.5s linear infinite;
}

.soq-sw__fab-ar--mid {
  inset: -8px;
  border: 1.5px solid rgba(18, 31, 62, 0.25);
  border-left-color: var(--soq-sw-gold);
  border-right-color: rgba(253, 224, 71, 0.7);
  opacity: 1;
  animation: soqSwFabSpin 6s linear infinite reverse;
}

.soq-sw__fab-ar--inner {
  inset: -2px;
  border: 1px dashed rgba(212, 175, 55, 0.5);
  border-top-color: var(--soq-sw-gold);
  animation: soqSwFabSpin 3.5s linear infinite;
}

.soq-sw__fab-ar-ticks {
  position: absolute;
  inset: -18px;
  background:
    linear-gradient(var(--soq-sw-gold), var(--soq-sw-gold)) top center / 2px 8px no-repeat,
    linear-gradient(var(--soq-sw-gold), var(--soq-sw-gold)) bottom center / 2px 8px no-repeat,
    linear-gradient(var(--soq-sw-gold), var(--soq-sw-gold)) center left / 8px 2px no-repeat,
    linear-gradient(var(--soq-sw-gold), var(--soq-sw-gold)) center right / 8px 2px no-repeat;
  animation: soqSwFabSpin 8s linear infinite reverse;
  opacity: 0.8;
  filter: drop-shadow(0 0 3px rgba(212, 175, 55, 0.6));
}

.soq-sw__fab-ar-beam {
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    transparent 250deg,
    rgba(18, 31, 62, 0.1) 290deg,
    rgba(212, 175, 55, 0.45) 330deg,
    rgba(253, 224, 71, 0.85) 348deg,
    transparent 360deg
  );
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 8px), #000 calc(100% - 6px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 8px), #000 calc(100% - 6px));
  animation: soqSwFabSpin 3s linear infinite;
}

.soq-sw__fab-ar-lock {
  position: absolute;
  top: -16px;
  left: 50%;
  width: 8px;
  height: 8px;
  margin-left: -4px;
  border-radius: 50%;
  background: var(--soq-sw-gold);
  box-shadow:
    0 0 8px rgba(212, 175, 55, 0.9),
    0 0 16px rgba(253, 224, 71, 0.7);
  animation: soqSwFabLock 3s linear infinite;
  transform-origin: 4px 52px;
}

.soq-sw__fab-icon--wa {
  position: relative;
  z-index: 1;
  width: 64px;
  height: 64px;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 6px 16px rgba(18, 31, 62, 0.35));
  pointer-events: none;
}

.soq-sw__fab-icon--close {
  position: relative;
  z-index: 1;
  display: none;
  color: #fff;
  font-size: 40px;
  line-height: 1;
  margin-top: -4px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.soq-sw.is-open .soq-sw__fab-icon--wa {
  display: none;
}

.soq-sw.is-open .soq-sw__fab-icon--close {
  display: block;
}

@keyframes soqSwFabSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes soqSwFabLock {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .soq-sw__fab-ar--outer,
  .soq-sw__fab-ar--mid,
  .soq-sw__fab-ar--inner,
  .soq-sw__fab-ar-ticks,
  .soq-sw__fab-ar-beam,
  .soq-sw__fab-ar-lock {
    animation: none;
  }

  .soq-sw__fab-ar-beam,
  .soq-sw__fab-ar-lock {
    opacity: 0.55;
  }
}

.soq-sw__panel {
  position: fixed;
  right: 48px;
  bottom: 134px;
  width: min(380px, calc(100vw - 24px));
  height: min(560px, calc(100vh - 120px));
  background: #fff;
  border-radius: var(--soq-sw-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(0, 51, 204, 0.08);
  box-shadow: 0 18px 40px rgba(18, 31, 62, 0.16);
  z-index: calc(var(--soq-sw-z) + 1);
  animation: soqSwIn 0.22s ease;
}

.soq-sw__panel[hidden] {
  display: none !important;
}

@keyframes soqSwIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.soq-sw__header {
  background:
    linear-gradient(135deg, var(--soq-sw-navy) 0%, var(--soq-sw-navy-mid) 72%, #223561 100%);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  position: relative;
}

.soq-sw__header::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 0;
  height: 2px;
  background: var(--soq-sw-lime);
  opacity: 0.85;
  border-radius: 2px 2px 0 0;
}

.soq-sw__avatar {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.14);
  border: 1.5px solid rgba(212, 175, 55, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.soq-sw__avatar img {
  width: 34px;
  height: 34px;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.soq-sw__header-text {
  flex: 1;
  min-width: 0;
}

.soq-sw__title {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.soq-sw__status {
  font-size: 12px;
  opacity: 0.95;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  font-weight: 500;
}

.soq-sw__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--soq-sw-lime);
  box-shadow: 0 0 0 0 rgba(204, 255, 0, 0.55);
  animation: soqSwPulse 1.8s infinite;
}

@keyframes soqSwPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(204, 255, 0, 0.55);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(204, 255, 0, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(204, 255, 0, 0);
  }
}

.soq-sw__minimize {
  background: rgba(255, 255, 255, 0.12);
  border: 0;
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.95;
  transition: background 0.15s ease;
}

.soq-sw__header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.soq-sw__new {
  background: rgba(255, 255, 255, 0.12);
  border: 0;
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.95;
  transition: background 0.15s ease;
}

.soq-sw__new:hover,
.soq-sw__minimize:hover {
  background: rgba(255, 255, 255, 0.22);
}

.soq-sw__new[hidden] {
  display: none !important;
}

.soq-sw__messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  background-color: var(--soq-sw-panel-bg);
  background-image:
    radial-gradient(circle at 12% 18%, rgba(0, 51, 204, 0.06) 0, transparent 42%),
    radial-gradient(circle at 88% 72%, rgba(204, 255, 0, 0.12) 0, transparent 38%),
    url("data:image/svg+xml,%3Csvg width='48' height='48' viewBox='0 0 48 48' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%230033CC' fill-opacity='0.035'%3E%3Ccircle cx='4' cy='4' r='1.5'/%3E%3Ccircle cx='28' cy='20' r='1.5'/%3E%3Ccircle cx='12' cy='36' r='1.5'/%3E%3C/g%3E%3C/svg%3E");
}

.soq-sw__row {
  display: flex;
  margin-bottom: 10px;
}

.soq-sw__row--out {
  justify-content: flex-end;
}

.soq-sw__bubble {
  max-width: 82%;
  padding: 10px 12px 7px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: 0 2px 8px rgba(18, 31, 62, 0.06);
  position: relative;
}

.soq-sw__md {
  white-space: normal;
}

.soq-sw__md-p {
  margin: 0 0 0.45em;
}

.soq-sw__md-p:last-child {
  margin-bottom: 0;
}

.soq-sw__md-list {
  margin: 0.35em 0 0.45em;
  padding-left: 1.2em;
}

.soq-sw__md-list li {
  margin: 0.15em 0;
}

.soq-sw__md a {
  color: var(--soq-sw-blue);
  text-decoration: underline;
  word-break: break-all;
}

.soq-sw__row--out .soq-sw__md a {
  color: #fff;
}

.soq-sw__chat {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.soq-sw__chat[hidden],
.soq-sw__gate[hidden] {
  display: none !important;
}

.soq-sw__gate {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 18px;
  background-color: var(--soq-sw-panel-bg);
}

.soq-sw__gate-card {
  text-align: center;
  max-width: 280px;
}

.soq-sw__gate-title {
  font-weight: 700;
  font-size: 17px;
  color: var(--soq-sw-navy);
  margin-bottom: 8px;
}

.soq-sw__gate-text {
  font-size: 13px;
  line-height: 1.45;
  color: var(--soq-sw-muted);
  margin: 0 0 18px;
}

.soq-sw__google {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 16px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--soq-sw-border);
  color: var(--soq-sw-navy);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(18, 31, 62, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.soq-sw__google:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(18, 31, 62, 0.12);
  color: var(--soq-sw-navy);
  text-decoration: none;
}

.soq-sw__row--in .soq-sw__bubble {
  background: var(--soq-sw-bubble-in);
  border: 1px solid rgba(216, 224, 236, 0.9);
  border-top-left-radius: 4px;
  color: var(--soq-sw-navy);
}

.soq-sw__row--out .soq-sw__bubble {
  background: var(--soq-sw-bubble-out);
  color: #fff;
  border-top-right-radius: 4px;
}

.soq-sw__row--out .soq-sw__time {
  color: rgba(255, 255, 255, 0.72);
}

.soq-sw__time {
  display: block;
  text-align: right;
  font-size: 10px;
  color: var(--soq-sw-muted);
  margin-top: 5px;
}

.soq-sw__typing {
  display: inline-flex;
  gap: 4px;
  padding: 12px 14px;
  background: #fff;
  border-radius: 16px;
  border-top-left-radius: 4px;
  border: 1px solid var(--soq-sw-border);
}

.soq-sw__typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--soq-sw-blue-mid);
  animation: soqSwDot 1.2s infinite ease-in-out;
}

.soq-sw__typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.soq-sw__typing span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes soqSwDot {
  0%,
  80%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.soq-sw__starter {
  flex-shrink: 0;
  padding: 8px 12px 4px;
  background: var(--soq-sw-surface);
  border-top: 1px solid var(--soq-sw-border);
}

.soq-sw__starter[hidden] {
  display: none !important;
}

.soq-sw__starter-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--soq-sw-muted);
  margin-bottom: 8px;
}

.soq-sw__tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 6px;
}

.soq-sw__tile {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  text-align: left;
  border: 1.5px solid var(--soq-sw-border);
  background: #fff;
  color: var(--soq-sw-navy);
  border-radius: 14px;
  padding: 10px 10px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.soq-sw__tile:hover {
  border-color: var(--soq-sw-blue);
  background: #f3f6ff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 51, 204, 0.08);
}

.soq-sw__tile:active {
  transform: translateY(0);
}

.soq-sw__tile-ico {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 51, 204, 0.08);
  color: var(--soq-sw-blue);
}

.soq-sw__tile-label {
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
  padding-top: 4px;
}

.soq-sw__followups {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 92%;
  margin: 2px 0 8px;
}

.soq-sw__follow {
  border: 1.5px solid var(--soq-sw-blue);
  background: #fff;
  color: var(--soq-sw-blue);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.soq-sw__follow:hover {
  background: var(--soq-sw-lime);
  border-color: var(--soq-sw-lime);
  color: #111;
}

.soq-sw__composer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: var(--soq-sw-surface);
  flex-shrink: 0;
}

.soq-sw__input {
  flex: 1;
  border: 1.5px solid var(--soq-sw-border);
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 14px;
  outline: none;
  background: #fff;
  color: var(--soq-sw-navy);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.soq-sw__input:focus {
  border-color: var(--soq-sw-blue-mid);
  box-shadow: 0 0 0 3px rgba(0, 51, 204, 0.12);
}

.soq-sw__input::placeholder {
  color: #8A97AD;
}

.soq-sw__send {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--soq-sw-lime);
  color: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 51, 204, 0.18);
  transition: background 0.15s ease, transform 0.15s ease;
}

.soq-sw__send:hover:not(:disabled) {
  background: var(--soq-sw-lime-hover);
  transform: scale(1.04);
}

.soq-sw__send:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.soq-sw__footer {
  font-size: 10px;
  text-align: center;
  color: var(--soq-sw-muted);
  padding: 4px 12px 6px;
  background: var(--soq-sw-surface);
  flex-shrink: 0;
  font-weight: 500;
}

.soq-sw__powered {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: inherit;
  text-decoration: none;
  line-height: 1;
  flex-wrap: wrap;
  opacity: 0.6;
}

.soq-sw__powered:hover {
  color: var(--soq-sw-navy, #54656f);
  text-decoration: none;
  opacity: 1;
}

.soq-sw__powered-label {
  font-size: 9px;
  letter-spacing: 0.02em;
}

.soq-sw__powered-logo {
  display: block;
  height: 12px;
  width: auto;
  max-width: min(90px, 100%);
  object-fit: contain;
}

.soq-sw__handover {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.soq-sw__handover a {
  display: inline-block;
  text-align: center;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 12px;
  border-radius: 999px;
  color: #fff;
  background: var(--soq-sw-blue);
}

.soq-sw__handover a:hover {
  background: var(--soq-sw-blue-dark);
}

.soq-sw__handover a.soq-sw__handover-wa {
  background: #25d366;
  color: #063;
}

.soq-sw__handover a.soq-sw__handover-wa:hover {
  background: #1ebe57;
}

@media (max-width: 480px) {
  .soq-sw__panel {
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
  }

  .soq-sw__fab {
    right: 28px;
    bottom: 28px;
  }

  .soq-sw.is-open .soq-sw__fab {
    display: none;
  }
}
