.wk-chat {
  --wk-accent: #06b04d;
  --wk-ink: #111;
  --wk-mute: #888888;
  --wk-line: rgba(17, 17, 17, 0.1);
  --wk-line-soft: rgba(17, 17, 17, 0.08);
  --wk-surface: rgba(255, 255, 255, 0.72);
  --wk-surface-strong: rgba(255, 255, 255, 0.94);
  --wk-card: #fff;
  --wk-media: #ececec;
  --wk-user: color-mix(in srgb, var(--wk-accent) 16%, white);
  --wk-panel-base: linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.18));
  --wk-shadow: rgba(15, 18, 22, 0.06);
  --wk-send: #000;
  --wk-send-ink: #fff;
  --wk-send-off: #333;
  --wk-close-bg: #fff;
  --wk-close-ink: #111;
  --wk-ring: #fff;
  --wk-avatar-bg: rgba(17, 17, 17, 0.06);
  --wk-avatar-line: rgba(17, 17, 17, 0.08);
  box-sizing: border-box;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: var(--wk-size, inherit);
  line-height: 1.5;
  letter-spacing: 0;
  color: var(--wk-ink);
}

.wk-chat--dark {
  --wk-ink: #f5f5f5;
  --wk-mute: #a3a3a3;
  --wk-line: rgba(255, 255, 255, 0.14);
  --wk-line-soft: rgba(255, 255, 255, 0.1);
  --wk-surface: rgba(255, 255, 255, 0.08);
  --wk-surface-strong: rgba(18, 18, 18, 0.96);
  --wk-card: #161616;
  --wk-media: #2a2a2a;
  --wk-user: color-mix(in srgb, var(--wk-accent) 28%, #111);
  --wk-panel-base: linear-gradient(180deg, rgba(24, 24, 24, 0.96), rgba(10, 10, 10, 0.94));
  --wk-shadow: rgba(0, 0, 0, 0.45);
  --wk-send: #f5f5f5;
  --wk-send-ink: #111;
  --wk-send-off: #6b6b6b;
  --wk-close-bg: #1c1c1c;
  --wk-close-ink: #f5f5f5;
  --wk-ring: #111;
  --wk-avatar-bg: rgba(255, 255, 255, 0.08);
  --wk-avatar-line: rgba(255, 255, 255, 0.14);
}

.wk-chat *,
.wk-chat *::before,
.wk-chat *::after {
  box-sizing: border-box;
}

.wk-chat--inline {
  display: block;
  width: 100%;
  max-width: 900px;
  margin-inline: auto;
  min-width: 0;
  overflow-x: clip;
}

.wk-chat--inline .wk-chat__panel {
  width: 100%;
}

.brxe-shortcode:has(.wk-chat--inline) {
  display: block;
  width: 100%;
}

.wk-chat__panel[hidden] {
  display: none !important;
}

.wk-chat__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 28rem;
  height: min(70vh, 40rem);
  border-radius: 28px;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 10% 100%, color-mix(in srgb, var(--wk-accent) 22%, transparent), transparent 46%),
    radial-gradient(90% 70% at 100% 0%, color-mix(in srgb, var(--wk-accent) 12%, transparent), transparent 42%),
    var(--wk-panel-base);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
}

.wk-chat__log {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1.6rem 1.15rem 0.6rem;
  mask-image: linear-gradient(to bottom, transparent, #000 12%);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 12%);
}

.wk-chat__thread {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.85rem;
  min-height: 100%;
  min-width: 0;
  max-width: 100%;
}

.wk-chat__row--bot {
  display: flex;
  align-items: flex-end;
  align-self: flex-start;
  gap: 0.5rem;
  max-width: 100%;
  min-width: 0;
  width: 100%;
  animation: wk-rise 1.15s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.wk-chat__avatar {
  display: block;
  width: 36px !important;
  height: 36px !important;
  min-width: 36px;
  min-height: 36px;
  flex: 0 0 36px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--wk-avatar-bg);
  border: 1px solid var(--wk-avatar-line);
}

.wk-chat__row--bot .wk-chat__bubble {
  max-width: 100%;
  min-width: 0;
  flex: 1 1 auto;
  animation: none;
}

.wk-chat__bubble {
  max-width: 78%;
  min-width: 0;
  padding: 0.85rem 1rem;
  border-radius: 1.15rem;
  line-height: 1.5;
  font-size: inherit;
  letter-spacing: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  color: var(--wk-ink);
  animation: wk-rise 1.15s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.wk-chat__bubble :is(h1, h2, h3, h4, h5, h6, p, small, span, a, strong, em, li, ul, ol, div) {
  font-size: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  font-style: normal;
  text-transform: none;
  margin: 0;
}

.wk-chat__bubble--rich {
  white-space: normal;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  max-width: min(100%, 36rem);
  min-width: 0;
  width: 100%;
}

.wk-chat__bubble :is(img, video, iframe, svg, canvas, embed, object) {
  max-width: 100% !important;
  height: auto !important;
}

.wk-chat__bubble :is(table, pre, code, kbd, samp) {
  max-width: 100%;
}

.wk-chat__bubble table {
  display: block;
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  -webkit-overflow-scrolling: touch;
}

.wk-chat__bubble :is(pre, code) {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.wk-chat__bubble pre {
  overflow-x: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

.wk-chat__bubble a {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.wk-chat__prose {
  margin: 0;
}

.wk-chat__prose strong,
.wk-chat__card-title,
.wk-chat__card-price,
.wk-chat__card-go {
  font-weight: 650;
}

.wk-chat__prose em {
  font-style: normal;
  font-weight: 650;
}

.wk-chat__slider {
  width: calc(100% + 0.35rem);
  margin-right: -0.35rem;
}

.wk-chat__slides {
  display: flex;
  gap: 0.55rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 0.1rem;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.15rem;
  scrollbar-width: none;
}

.wk-chat__slides::-webkit-scrollbar {
  display: none;
}

.wk-chat__slides .wk-chat__card {
  flex: 0 0 min(82%, 17.5rem);
  width: min(82%, 17.5rem);
  max-width: 17.5rem;
  min-height: 5.6rem;
  scroll-snap-align: start;
}

.wk-chat__slides .wk-chat__card-media {
  flex-basis: 5.6rem;
  width: 5.6rem;
  min-width: 5.6rem;
  min-height: 5.6rem;
}

.wk-chat__card {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 0;
  padding: 0;
  overflow: hidden;
  min-height: 6.75rem;
  border-radius: 16px;
  text-decoration: none;
  color: var(--wk-ink);
  background: var(--wk-card);
  border: 1px solid var(--wk-line);
  box-shadow: 0 1px 2px var(--wk-shadow);
  transition: border-color 0.35s ease, transform 0.35s ease, box-shadow 0.35s ease;
}

.wk-chat__card-media {
  flex: 0 0 6.75rem;
  width: 6.75rem;
  min-width: 6.75rem;
  min-height: 6.75rem;
  background: var(--wk-media);
}

.wk-chat__card-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.wk-chat__card-img.is-in {
  opacity: 1;
}

.wk-chat__card-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.18rem;
  min-width: 0;
  flex: 1;
  padding: 0.7rem 0.85rem 0.7rem 0.8rem;
}

.wk-chat__card:hover,
.wk-chat__card:focus-visible {
  border-color: color-mix(in srgb, var(--wk-accent) 55%, var(--wk-line));
  box-shadow: 0 8px 20px color-mix(in srgb, var(--wk-accent) 12%, var(--wk-shadow));
  transform: translateY(-1px);
  outline: none;
}

.wk-chat__card-title {
  font-weight: 650;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.wk-chat__card-price {
  font-weight: 650;
  color: var(--wk-ink);
}

.wk-chat__card-blurb {
  font-weight: 400;
  color: var(--wk-ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.wk-chat__card-go {
  margin-top: 0.2rem;
  font-weight: 650;
  color: var(--wk-ink);
}

.wk-chat__bubble--bot,
.wk-chat__bubble--err {
  align-self: flex-start;
  color: var(--wk-ink);
  background: var(--wk-surface);
  border: 1px solid var(--wk-line-soft);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.wk-chat__bubble--user {
  align-self: flex-end;
  max-width: min(78%, 100%);
  color: var(--wk-ink);
  background: var(--wk-user);
  border: 1px solid color-mix(in srgb, var(--wk-accent) 22%, transparent);
}

.wk-chat__bubble--wait {
  min-width: 3.2rem;
  display: flex;
  gap: 0.28rem;
  align-items: center;
}

.wk-chat__bubble--wait i {
  width: 0.38rem;
  height: 0.38rem;
  border-radius: 50%;
  background: var(--wk-mute);
  animation: wk-dot 1.4s ease-in-out infinite;
}

.wk-chat__bubble--wait i:nth-child(2) { animation-delay: 0.16s; }
.wk-chat__bubble--wait i:nth-child(3) { animation-delay: 0.32s; }

.wk-chat__form {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: 1fr auto;
  align-items: stretch;
  gap: 0.35rem 0.55rem;
  box-sizing: border-box;
  min-width: 0;
  width: calc(100% - 1.7rem);
  max-width: calc(100% - 1.7rem);
  margin: 0.55rem 0.85rem 0.45rem;
  padding: 0.85rem 0.85rem 0.7rem;
  min-height: 5.75rem;
  background: var(--wk-surface-strong);
  border: 1px solid var(--wk-line-soft);
  border-radius: 24px;
  box-shadow:
    0 1px 2px var(--wk-shadow),
    0 8px 24px var(--wk-shadow);
  transition: border-color 0.5s ease, box-shadow 0.5s ease;
}

.wk-chat__form:last-child {
  margin-bottom: 0.9rem;
}

.wk-chat__note {
  flex: 0 0 auto;
  margin: 0 1.15rem 0.7rem !important;
  padding: 0;
  text-align: center;
  font-size: 0.62em !important;
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: 0;
  color: var(--wk-mute);
}

.wk-chat__form:focus-within {
  border-color: color-mix(in srgb, var(--wk-accent) 32%, var(--wk-line));
  box-shadow:
    0 1px 2px var(--wk-shadow),
    0 10px 28px color-mix(in srgb, var(--wk-accent) 10%, var(--wk-shadow));
}

.wk-chat__input {
  grid-column: 1 / -1;
  grid-row: 1;
  width: 100%;
  min-width: 0;
  resize: none;
  border: 0;
  outline: none;
  background: transparent;
  border-radius: 0;
  padding: 0.1rem 0.35rem 0.2rem;
  font-family: inherit;
  font-weight: inherit;
  font-style: inherit;
  font-size: var(--wk-size, inherit) !important;
  line-height: 1.45 !important;
  letter-spacing: inherit;
  color: var(--wk-ink);
  min-height: 2.4rem;
  max-height: 8rem;
  box-shadow: none;
  transition: none;
}

.wk-chat__input:focus {
  background: transparent;
  box-shadow: none;
}

.wk-chat__input::placeholder {
  color: var(--wk-mute);
}

.wk-chat__send {
  grid-column: 2;
  grid-row: 2;
  justify-self: end;
  align-self: end;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  color: var(--wk-send-ink);
  background: var(--wk-send);
  display: grid;
  place-items: center;
  font-size: 0;
  line-height: 0;
  overflow: hidden;
  text-indent: 0;
  white-space: nowrap;
  transition: transform 0.5s ease, opacity 0.5s ease, filter 0.5s ease;
}

.wk-chat__send::before,
.wk-chat__send::after {
  content: none !important;
}

.wk-chat__send svg {
  width: 0.95rem;
  height: 0.95rem;
  display: block;
  flex-shrink: 0;
}

.wk-chat__send:disabled {
  background: var(--wk-send-off);
  cursor: not-allowed;
  opacity: 1;
}

.wk-chat__launcher,
.wk-chat__close {
  border: 0;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(16px);
}

.wk-chat__dock {
  position: fixed;
  right: 1.2rem;
  bottom: 1.2rem;
  z-index: 9998;
  width: 3.75rem;
  height: 3.75rem;
}

.wk-chat__launcher {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block !important;
  width: 100%;
  height: 100%;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 50%;
  overflow: hidden;
  background: var(--wk-accent) !important;
  box-shadow: 0 10px 28px color-mix(in srgb, var(--wk-accent) 35%, transparent);
  line-height: 0;
}

.wk-chat__launcher img {
  position: absolute;
  top: 3px;
  left: 3px;
  width: calc(100% - 6px) !important;
  height: calc(100% - 6px) !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  border-radius: 50%;
  object-fit: cover;
  object-position: center center;
  display: block;
}

.wk-chat__online {
  position: absolute;
  right: 0.12rem;
  bottom: 0.12rem;
  z-index: 2;
  width: 0.72rem;
  height: 0.72rem;
  margin: 0;
  border: 0 !important;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 2px #fff;
  pointer-events: none;
}

.wk-chat__close {
  position: absolute;
  top: 0.7rem;
  right: 0.8rem;
  z-index: 3;
  display: grid !important;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0 !important;
  border-radius: 50%;
  background: var(--wk-close-bg) !important;
  color: var(--wk-close-ink) !important;
  line-height: 0;
}

.wk-chat__close::before,
.wk-chat__close::after {
  content: none !important;
}

.wk-chat__close svg {
  width: 0.85rem;
  height: 0.85rem;
  display: block;
}

.wk-chat--floating .wk-chat__panel {
  position: fixed;
  right: 1.2rem;
  bottom: 5rem;
  z-index: 9999;
  width: min(24rem, calc(100vw - 2rem));
}

.wk-chat .screen-reader-text {
  clip: rect(1px, 1px, 1px, 1px);
  height: 1px;
  overflow: hidden;
  position: absolute;
  width: 1px;
}

@keyframes wk-rise {
  from {
    opacity: 0;
    filter: blur(14px);
    transform: translateY(36px) scale(0.98);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) scale(1);
  }
}

@keyframes wk-dot {
  0%, 80%, 100% { opacity: 0.25; transform: translateY(4px); }
  40% { opacity: 1; transform: translateY(-2px); }
}

@media (prefers-reduced-motion: reduce) {
  .wk-chat__bubble,
  .wk-chat__row--bot,
  .wk-chat__bubble--wait i,
  .wk-chat__input,
  .wk-chat__send {
    animation: none;
    transition: none;
  }
}
