.pai-widget-root {
  --pai-accent: #ffd60a;
  --pai-bg: #06060a;
  --pai-panel: #0b0b11;
  --pai-text: #f4f4f6;
  --pai-muted: #8a8a94;
  --pai-radius: 16px;
  --pai-width: 380px;
  --pai-font: Manrope, Arial, sans-serif;
  --pai-mono: "JetBrains Mono", monospace;
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 2147483000;
  color: var(--pai-text);
  font-family: var(--pai-font);
}

.pai-widget-root[data-position="left"] {
  right: auto;
  left: 20px;
}

.pai-widget-root *,
.pai-widget-root *::before,
.pai-widget-root *::after {
  box-sizing: border-box;
}

.pai-widget-root button,
.pai-widget-root input,
.pai-widget-root select {
  font: inherit;
}

#pai-widget-root button,
#pai-widget-root input,
#pai-widget-root select {
  min-width: 0 !important;
  min-height: 0 !important;
  box-shadow: none !important;
  text-transform: none !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}

/* Neutralize the host theme's corner radius on widget controls — but NOT the
   launcher: its shape is user-configurable (launcher_shape) and driven by the
   per-shape rules + inline style. Including it here forced it square. */
#pai-widget-root button:not(.pai-launcher),
#pai-widget-root input,
#pai-widget-root select {
  border-radius: 0 !important;
}

.pai-widget {
  position: relative;
  width: 62px;
  height: 62px;
}

.pai-launcher {
  position: absolute;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 62px;
  height: 62px;
  padding: 0;
  border: 0;
  color: var(--pai-accent);
  background: #0b0b11;
  /* default shape: cut corners */
  clip-path: polygon(0 12px, 12px 0, calc(100% - 12px) 0, 100% 12px, 100% calc(100% - 12px), calc(100% - 12px) 100%, 12px 100%, 0 calc(100% - 12px));
  border-radius: 0;
  cursor: pointer;
  filter: drop-shadow(0 0 18px color-mix(in srgb, var(--pai-accent) 74%, transparent));
  transition: transform 0.24s ease, filter 0.24s ease, border-radius 0.3s ease, clip-path 0.3s ease;
}

/* shape overrides */
.pai-widget[data-launcher-shape="circle"] .pai-launcher {
  clip-path: none;
  border-radius: 50%;
}
.pai-widget[data-launcher-shape="circle"] .pai-launcher::before { clip-path: none; border-radius: 50%; }
.pai-widget[data-launcher-shape="circle"] .pai-launcher::after  { clip-path: none; border-radius: 50%; inset: 2px; }

.pai-widget[data-launcher-shape="rounded"] .pai-launcher {
  clip-path: none;
  border-radius: 18px;
}
.pai-widget[data-launcher-shape="rounded"] .pai-launcher::before { clip-path: none; border-radius: 18px; }
.pai-widget[data-launcher-shape="rounded"] .pai-launcher::after  { clip-path: none; border-radius: 16px; }

.pai-widget[data-launcher-shape="square"] .pai-launcher {
  clip-path: none;
  border-radius: 6px;
}
.pai-widget[data-launcher-shape="square"] .pai-launcher::before { clip-path: none; border-radius: 6px; }
.pai-widget[data-launcher-shape="square"] .pai-launcher::after  { clip-path: none; border-radius: 4px; }

/* ::before (gradient border) and ::after (inner fill) inherit the button's
   clip-path AND border-radius, so the inline shape style set in JS drives the
   whole launcher — immune to a stale/aggregated CSS file. */
.pai-launcher::before {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(135deg, var(--pai-accent), color-mix(in srgb, var(--pai-accent) 52%, #ffffff));
  clip-path: inherit;
  border-radius: inherit;
}

.pai-launcher::after {
  position: absolute;
  inset: 2px;
  content: "";
  background: #0b0b11;
  clip-path: inherit;
  border-radius: inherit;
}

.pai-launcher > * {
  position: relative;
  z-index: 1;
}

.pai-launcher:hover {
  transform: translateY(-2px) scale(1.02);
}

.pai-launcher svg {
  width: 28px;
  height: 28px;
  filter: drop-shadow(0 0 6px var(--pai-accent));
}

.pai-widget[data-open="true"] .pai-launcher {
  transform: scale(0.86);
}

.pai-widget[data-glow="true"] .pai-launcher:not(:hover) {
  animation: paiGlowPulse 2.6s ease-in-out infinite;
}

.pai-panel {
  position: absolute;
  right: 0;
  bottom: 76px;
  display: flex;
  width: min(var(--pai-width), calc(100vw - 32px));
  height: min(600px, calc(100vh - 112px));
  overflow: hidden;
  flex-direction: column;
  pointer-events: none;
  background:
    radial-gradient(circle at 80% 82%, color-mix(in srgb, var(--pai-accent) 12%, transparent), transparent 48%),
    radial-gradient(circle at 18% 18%, color-mix(in srgb, var(--pai-accent) 5%, transparent), transparent 38%),
    var(--pai-panel);
  border: 1px solid color-mix(in srgb, var(--pai-accent) 52%, transparent);
  border-radius: var(--pai-radius);
  box-shadow: 0 24px 62px rgba(0, 0, 0, 0.72), 0 0 42px color-mix(in srgb, var(--pai-accent) 22%, transparent);
  opacity: 0;
  transform: translateY(22px) scale(0.97);
  transform-origin: bottom right;
  transition: opacity 0.28s ease, transform 0.34s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.pai-widget-root[data-position="left"] .pai-panel {
  right: auto;
  left: 0;
  transform-origin: bottom left;
}

.pai-widget[data-border="cut"] .pai-panel {
  border-radius: 0;
  clip-path: polygon(0 14px, 14px 0, calc(100% - 14px) 0, 100% 14px, 100% calc(100% - 14px), calc(100% - 14px) 100%, 14px 100%, 0 calc(100% - 14px));
}

.pai-widget[data-border="sharp"] .pai-panel {
  border-radius: 0;
}

.pai-widget[data-open="true"] .pai-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.pai-panel::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(color-mix(in srgb, var(--pai-accent) 7%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--pai-accent) 7%, transparent) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(circle at 80% 90%, black, transparent 72%);
}

.pai-panel::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--pai-accent) 16%, transparent), inset 0 0 36px rgba(0, 0, 0, 0.42);
}

.pai-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid color-mix(in srgb, var(--pai-accent) 18%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--pai-accent) 7%, transparent), transparent);
}

.pai-eq-box {
  display: grid;
  min-width: 66px;
  padding: 5px 8px;
  border: 1px solid color-mix(in srgb, var(--pai-accent) 48%, transparent);
  background: #000;
  box-shadow: inset 0 0 12px color-mix(in srgb, var(--pai-accent) 22%, transparent), 0 0 16px color-mix(in srgb, var(--pai-accent) 36%, transparent);
}

.pai-eq {
  display: inline-flex;
  align-items: center;
  height: 16px;
  gap: 3px;
}

.pai-eq i {
  display: block;
  width: 3px;
  height: 35%;
  border-radius: 999px;
  background: var(--pai-accent);
  box-shadow: 0 0 8px var(--pai-accent);
  animation: paiBars 0.92s ease-in-out infinite;
}

.pai-eq i:nth-child(2) {
  animation-delay: 0.12s;
}

.pai-eq i:nth-child(3) {
  animation-delay: 0.24s;
}

.pai-eq i:nth-child(4) {
  animation-delay: 0.36s;
}

.pai-eq i:nth-child(5) {
  animation-delay: 0.48s;
}

.pai-eq-label {
  margin-top: 4px;
  color: var(--pai-accent);
  font-family: var(--pai-mono);
  font-size: 8px;
  letter-spacing: 0.14em;
  text-shadow: 0 0 8px var(--pai-accent);
  text-transform: uppercase;
}

.pai-title {
  min-width: 0;
  flex: 1;
}

.pai-title strong {
  display: block;
  overflow: hidden;
  color: var(--pai-text);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.11em;
  line-height: 1.1;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.pai-title span {
  display: block;
  margin-top: 5px;
  color: color-mix(in srgb, var(--pai-muted) 72%, transparent);
  font-family: var(--pai-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.pai-language {
  width: 58px;
  min-height: 28px;
  border: 1px solid color-mix(in srgb, var(--pai-accent) 38%, transparent);
  background: #000;
  color: var(--pai-accent);
  font-family: var(--pai-mono);
  font-size: 10px;
}

#pai-widget-root .pai-language {
  display: block !important;
  width: 58px !important;
  height: 28px !important;
  min-width: 58px !important;
  flex: 0 0 58px !important;
  padding: 0 18px 0 8px !important;
  border: 1px solid color-mix(in srgb, var(--pai-accent) 38%, transparent) !important;
  background: #000 !important;
  color: var(--pai-accent) !important;
  font-family: var(--pai-mono) !important;
  font-size: 10px !important;
  line-height: 1 !important;
}

.pai-close {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--pai-accent) 42%, transparent);
  background: transparent;
  color: var(--pai-accent);
  cursor: pointer;
}

#pai-widget-root .pai-close {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  flex: 0 0 28px !important;
  padding: 0 !important;
  border: 1px solid color-mix(in srgb, var(--pai-accent) 42%, transparent) !important;
  background: transparent !important;
  color: var(--pai-accent) !important;
  font-size: 16px !important;
  line-height: 1 !important;
}

.pai-widget[data-scanline="true"] .pai-header::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, var(--pai-accent), transparent);
  opacity: 0.65;
  animation: paiScan 2.4s linear infinite;
}

.pai-messages {
  position: relative;
  z-index: 1;
  display: flex;
  overflow-y: auto;
  flex: 1;
  flex-direction: column;
  gap: 14px;
  padding: 14px 16px 12px;
  scrollbar-color: color-mix(in srgb, var(--pai-accent) 42%, transparent) transparent;
  scrollbar-width: thin;
}

.pai-message {
  animation: paiMessageIn 0.22s ease both;
}

.pai-message__label {
  margin-bottom: 6px;
  color: var(--pai-accent);
  font-family: var(--pai-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-shadow: 0 0 8px var(--pai-accent);
}

.pai-message__bubble {
  max-width: 88%;
  padding: 9px 12px;
  color: var(--pai-text);
  background: color-mix(in srgb, var(--pai-accent) 7%, transparent);
  border-left: 2px solid var(--pai-accent);
  box-shadow: inset 0 0 22px color-mix(in srgb, var(--pai-accent) 10%, transparent);
  line-height: 1.55;
  white-space: pre-wrap;
}

.pai-message--user {
  display: flex;
  justify-content: flex-end;
}

.pai-message--user .pai-message__bubble {
  max-width: 78%;
  border-left: 0;
  background: var(--pai-accent);
  color: #000;
  font-weight: 700;
  box-shadow: 0 0 22px color-mix(in srgb, var(--pai-accent) 40%, transparent);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%);
}

.pai-message--typing .pai-message__bubble {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  color: var(--pai-muted);
  font-family: var(--pai-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.pai-typewriter.is-typing::after {
  display: inline-block;
  width: 7px;
  margin-left: 2px;
  color: var(--pai-accent);
  content: "▌";
  text-shadow: 0 0 8px var(--pai-accent);
  animation: paiCursor 0.72s steps(1) infinite;
}

.pai-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.pai-chip {
  padding: 5px 9px;
  border: 1px solid color-mix(in srgb, var(--pai-accent) 48%, transparent);
  background: transparent;
  color: var(--pai-accent);
  cursor: pointer;
  font-family: var(--pai-mono);
  font-size: 10px;
  text-shadow: 0 0 6px var(--pai-accent);
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

#pai-widget-root .pai-chip {
  display: inline-flex !important;
  align-items: center !important;
  width: auto !important;
  height: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 5px 9px !important;
  border: 1px solid color-mix(in srgb, var(--pai-accent) 48%, transparent) !important;
  background: transparent !important;
  color: var(--pai-accent) !important;
  font-family: var(--pai-mono) !important;
  font-size: 10px !important;
  font-weight: 400 !important;
  line-height: 1.35 !important;
  letter-spacing: 0 !important;
  text-shadow: 0 0 6px var(--pai-accent) !important;
}

.pai-chip:hover,
.pai-chip:focus {
  background: var(--pai-accent);
  color: #000;
  box-shadow: 0 0 14px color-mix(in srgb, var(--pai-accent) 70%, transparent);
  text-shadow: none;
}

/* "Оглянути всі варіанти" — a link-chip that opens the filtered catalog. */
.pai-browseall {
  margin-top: 8px;
}
.pai-disclosure {
  padding: 6px 14px 10px;
  font-size: 10px;
  line-height: 1.4;
  color: var(--pai-muted);
  opacity: 0.85;
}
.pai-disclosure a {
  color: var(--pai-accent);
  text-decoration: underline;
}
.pai-consent {
  margin: 8px 12px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--pai-accent) 35%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--pai-accent) 8%, transparent);
}
.pai-consent__row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 12px;
  color: var(--pai-text);
  cursor: pointer;
}
.pai-consent__row input {
  margin-top: 2px;
  flex: 0 0 auto;
}
.pai-consent__row a {
  color: var(--pai-accent);
  text-decoration: underline;
}
.pai-consent__accept {
  margin-top: 10px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: 8px;
  background: var(--pai-accent);
  color: #000;
  font-weight: 700;
  cursor: pointer;
}
.pai-consent__accept:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
#pai-widget-root .pai-chip--browse {
  background: color-mix(in srgb, var(--pai-accent) 18%, transparent) !important;
  text-decoration: none !important;
  font-weight: 600 !important;
}
#pai-widget-root .pai-chip--browse:hover,
#pai-widget-root .pai-chip--browse:focus {
  background: var(--pai-accent) !important;
  color: #000 !important;
  text-shadow: none !important;
}

.pai-lead-form {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
  padding: 10px 14px 12px;
  border-top: 1px solid color-mix(in srgb, var(--pai-accent) 18%, transparent);
  background: rgba(0, 0, 0, 0.58);
}

.pai-lead-form__title {
  color: var(--pai-accent);
  font-family: var(--pai-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.pai-lead-form input {
  width: 100%;
  min-height: 34px;
  border: 1px solid color-mix(in srgb, var(--pai-accent) 24%, transparent);
  background: #000;
  color: var(--pai-text);
  padding: 8px 10px;
}

.pai-inputbar {
  position: relative;
  z-index: 1;
  padding: 10px 14px 14px;
  border-top: 1px solid color-mix(in srgb, var(--pai-accent) 18%, transparent);
  background: rgba(0, 0, 0, 0.56);
}

.pai-form {
  display: flex;
  border: 1px solid color-mix(in srgb, var(--pai-accent) 34%, transparent);
  background: #000;
  box-shadow: inset 0 0 14px color-mix(in srgb, var(--pai-accent) 12%, transparent);
}

.pai-prompt-prefix {
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-right: 1px solid color-mix(in srgb, var(--pai-accent) 22%, transparent);
  color: var(--pai-accent);
  font-family: var(--pai-mono);
}

.pai-input {
  min-width: 0;
  flex: 1;
  padding: 12px 8px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--pai-text);
}

#pai-widget-root .pai-input {
  width: auto !important;
  height: auto !important;
  min-width: 0 !important;
  padding: 12px 8px !important;
  border: 0 !important;
  background: transparent !important;
  color: var(--pai-text) !important;
  font-size: 13px !important;
  line-height: 1.3 !important;
}

.pai-send {
  padding: 0 14px;
  border: 0;
  border-left: 1px solid color-mix(in srgb, var(--pai-accent) 32%, transparent);
  background: transparent;
  color: color-mix(in srgb, var(--pai-accent) 54%, transparent);
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

#pai-widget-root .pai-send {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  height: auto !important;
  min-width: 0 !important;
  min-height: 42px !important;
  padding: 0 14px !important;
  border: 0 !important;
  border-left: 1px solid color-mix(in srgb, var(--pai-accent) 32%, transparent) !important;
  background: transparent !important;
  color: color-mix(in srgb, var(--pai-accent) 54%, transparent) !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  letter-spacing: 0.14em !important;
  text-transform: uppercase !important;
}

.pai-send:not(:disabled) {
  background: var(--pai-accent);
  color: #000;
  box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.25), 0 0 18px color-mix(in srgb, var(--pai-accent) 54%, transparent);
}

#pai-widget-root .pai-send:not(:disabled) {
  background: var(--pai-accent) !important;
  color: #000 !important;
  box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.25), 0 0 18px color-mix(in srgb, var(--pai-accent) 54%, transparent) !important;
}

.pai-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  color: color-mix(in srgb, var(--pai-muted) 70%, transparent);
  font-family: var(--pai-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.pai-live {
  color: var(--pai-accent);
  text-shadow: 0 0 8px var(--pai-accent);
}

.pai-widget[data-skin="studio"] .pai-launcher {
  /* Shape is owned by launcher_shape (data-launcher-shape rules + inline style).
     The skin only sets colour/shadow, so the chosen shape always applies and
     ::before/::after keep inheriting clip-path + border-radius from the button. */
  background: #0e0e11;
  filter: drop-shadow(0 10px 28px rgba(0, 0, 0, 0.55));
}

.pai-widget[data-skin="studio"] .pai-panel {
  clip-path: none;
  border-color: rgba(255, 255, 255, 0.08);
  border-radius: var(--pai-radius);
  background:
    radial-gradient(circle at 82% 90%, color-mix(in srgb, var(--pai-accent) 8%, transparent), transparent 52%),
    repeating-linear-gradient(0deg, transparent 0 19px, rgba(255, 255, 255, 0.012) 19px 20px),
    var(--pai-panel);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.72), 0 0 0 1px color-mix(in srgb, var(--pai-accent) 20%, transparent);
}

.pai-widget[data-skin="studio"] .pai-panel::before {
  background-image: repeating-linear-gradient(90deg, transparent 0 19px, rgba(255, 255, 255, 0.014) 19px 20px);
  background-size: auto;
  mask-image: none;
}

.pai-widget[data-skin="studio"] .pai-eq-box {
  min-width: 38px;
  border-radius: 9px;
}

.pai-widget[data-skin="studio"] .pai-message__bubble,
.pai-widget[data-skin="studio"] .pai-chip,
.pai-widget[data-skin="studio"] .pai-form,
.pai-widget[data-skin="studio"] .pai-send {
  border-radius: 10px;
}

.pai-widget[data-skin="minimal"] .pai-launcher {
  /* Shape owned by launcher_shape; skin only sets size/border/glow. */
  width: 54px;
  height: 54px;
  border: 1px solid var(--pai-accent);
  background: #0a0a0c;
  filter: none;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--pai-accent) 24%, transparent), 0 0 24px color-mix(in srgb, var(--pai-accent) 36%, transparent), inset 0 0 12px color-mix(in srgb, var(--pai-accent) 10%, transparent);
}

.pai-widget[data-skin="minimal"] .pai-launcher::before,
.pai-widget[data-skin="minimal"] .pai-launcher::after {
  display: none;
}

.pai-widget[data-skin="minimal"] .pai-panel {
  clip-path: none;
  border-color: rgba(255, 255, 255, 0.07);
  border-radius: var(--pai-radius);
  background: #0a0a0c;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85), inset 2px 0 0 var(--pai-accent);
}

.pai-widget[data-skin="minimal"] .pai-panel::before {
  background-image: radial-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 20px 20px;
  mask-image: none;
}

.pai-widget[data-skin="minimal"] .pai-header {
  align-items: flex-start;
  padding: 18px 18px 14px 24px;
  border-bottom-color: rgba(255, 255, 255, 0.06);
  background: transparent;
}

.pai-widget[data-skin="minimal"] .pai-eq-box {
  display: none;
}

.pai-widget[data-skin="minimal"] .pai-title strong {
  font-size: 22px;
  letter-spacing: 0;
  text-transform: none;
}

.pai-widget[data-skin="minimal"] .pai-title span {
  color: var(--pai-accent);
  font-size: 9px;
}

.pai-widget[data-skin="minimal"] .pai-messages {
  gap: 18px;
  padding: 14px 18px 10px 24px;
}

.pai-widget[data-skin="minimal"] .pai-message {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.pai-widget[data-skin="minimal"] .pai-message--user {
  justify-content: stretch;
}

.pai-widget[data-skin="minimal"] .pai-message__label {
  margin: 4px 0 0;
}

.pai-widget[data-skin="minimal"] .pai-message__bubble,
.pai-widget[data-skin="minimal"] .pai-message--user .pai-message__bubble {
  max-width: none;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  clip-path: none;
  color: var(--pai-text);
  font-weight: 400;
}

.pai-widget[data-skin="minimal"] .pai-message--user::before {
  margin-top: 4px;
  color: var(--pai-muted);
  font-family: var(--pai-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  content: "YOU";
}

.pai-widget[data-skin="minimal"] .pai-suggestions {
  grid-column: 2;
}

.pai-widget[data-skin="minimal"] .pai-chip {
  padding: 2px 0;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--pai-accent) 55%, transparent);
  background: transparent;
  text-shadow: none;
}

.pai-widget[data-skin="minimal"] .pai-inputbar,
.pai-widget[data-skin="minimal"] .pai-form {
  background: transparent;
  box-shadow: none;
}

.pai-widget[data-skin="minimal"] .pai-form {
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.pai-widget[data-skin="minimal"] .pai-send {
  border-left: 0;
  background: transparent;
  color: var(--pai-accent);
  box-shadow: none;
}

@keyframes paiGlowPulse {
  0%, 100% {
    filter: drop-shadow(0 0 14px color-mix(in srgb, var(--pai-accent) 52%, transparent));
  }

  50% {
    filter: drop-shadow(0 0 28px color-mix(in srgb, var(--pai-accent) 86%, transparent));
  }
}

@keyframes paiBars {
  0%, 100% {
    height: 35%;
  }

  50% {
    height: 100%;
  }
}

@keyframes paiScan {
  0% {
    transform: translateX(-36%);
  }

  100% {
    transform: translateX(36%);
  }
}

@keyframes paiMessageIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes paiCursor {
  0%, 49% {
    opacity: 1;
  }

  50%, 100% {
    opacity: 0;
  }
}

/* ── Mobile: push launcher above the WoodMart/WooCommerce bottom nav bar ── */
@media (max-width: 768px) {
  .pai-widget-root,
  .pai-widget-root[data-position="left"] {
    bottom: 76px; /* clear 60-70 px bottom nav + breathing room */
  }
}

@media (max-width: 480px) {
  .pai-widget-root,
  .pai-widget-root[data-position="left"] {
    right: 12px;
    bottom: 80px;
    left: auto;
  }

  /* Panel needs a viewport-based width: its containing block (.pai-widget) is
     only 62px wide, so the old left:0/right:0/width:auto collapsed it to a
     sliver (text wrapped one syllable per line). Anchor to the launcher edge
     (right:0) and span the viewport minus symmetric 12px side margins. */
  .pai-panel,
  .pai-widget-root[data-position="left"] .pai-panel {
    right: 0;
    left: auto;
    width: calc(100vw - 24px);
    height: min(640px, calc(100vh - 160px));
  }

  .pai-header {
    padding-right: 12px;
    padding-left: 12px;
  }

  .pai-eq-box {
    min-width: 58px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #pai-widget-root *,
  #pai-widget-root *::before,
  #pai-widget-root *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
/* Visible keyboard-focus ring for accessibility (was relying on UA default). */
#pai-widget-root :focus-visible {
  outline: 2px solid var(--pai-accent);
  outline-offset: 2px;
}
#pai-widget-root .pai-panel:focus {
  outline: none;
}
/* ── Status line fade-in animation ──────────────────────── */
.pai-status-line {
  display: block;
  animation: paiStatusIn 0.5s cubic-bezier(.2,.7,.3,1) both;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@keyframes paiStatusIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── New icon glyphs ─────────────────────────────────────── */
/* pulse icon — animated radio waves */
.pai-launcher .pai-icon-pulse circle {
  animation: paiPulseDot 2s ease-in-out infinite;
}
.pai-launcher .pai-icon-pulse path:nth-child(2) {
  animation: paiPulseRing 2s ease-in-out 0.15s infinite;
}
.pai-launcher .pai-icon-pulse path:nth-child(3) {
  animation: paiPulseRing 2s ease-in-out 0.3s infinite;
}
@keyframes paiPulseDot {
  0%, 100% { opacity: 1; } 50% { opacity: 0.5; }
}
@keyframes paiPulseRing {
  0%, 100% { opacity: 1; } 50% { opacity: 0.3; }
}

/* Admin icon preview glyphs */
.pai-icon-glyph--pulse,
.pai-icon-glyph--mono {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
}

/* ══════════════════════════════════════════════════════════════
   Robot avatar — animated golden mascot (matches Mascot mockup 1:1)
══════════════════════════════════════════════════════════════ */
.pai-robot {
  --accent: var(--pai-accent);
  --accent-soft: color-mix(in srgb, var(--pai-accent) 50%, transparent);
  position: relative;
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  background: linear-gradient(158deg, #2a2930 0%, #18171d 45%, #101015 100%);
  box-shadow: 0 8px 20px -10px rgba(0,0,0,0.8), inset 0 1px 0 rgba(255,255,255,0.10), inset 0 0 0 1px rgba(255,255,255,0.04);
}
.pai-robot::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(60px 40px at 50% 12%, rgba(255,255,255,0.10), transparent 60%);
}
.pai-robot svg.robot {
  position: relative;
  z-index: 1;
  display: block;
  width: 88%;
  height: 88%;
  overflow: visible;
}
.pai-robot .r-eyes { filter: drop-shadow(0 0 4px var(--accent)) drop-shadow(0 0 9px var(--accent-soft)); }
.pai-robot .r-antenna-dot { filter: drop-shadow(0 0 3px var(--accent)); }

/* transform-origin helpers for SVG parts */
.pai-robot .r-body,
.pai-robot .r-eyes,
.pai-robot .r-eye,
.pai-robot .r-pupils,
.pai-robot .r-eqbar,
.pai-robot .r-scan,
.pai-robot .r-sonar,
.pai-robot .r-burst,
.pai-robot .r-eye-l,
.pai-robot .r-eye-r { transform-box: fill-box; transform-origin: center; }

/* extras hidden until their mode shows them */
.pai-robot .r-sonar,
.pai-robot .r-scan,
.pai-robot .r-eqbar,
.pai-robot .r-thinkdot,
.pai-robot .r-burst { opacity: 0; }

/* ── idle: calm float + rare blink ── */
.pai-robot.m-idle .r-body { animation: prBob 4s ease-in-out infinite; }
.pai-robot.m-idle .r-eye-l,
.pai-robot.m-idle .r-eye-r { animation: prBlink 5s ease-in-out infinite; }

/* ── listen: sonar rings from ear-cups + eye glow pulse ── */
.pai-robot.m-listen .r-body { animation: prBob 3.4s ease-in-out infinite; }
.pai-robot.m-listen .r-eyes { animation: prEyeGlow 1.6s ease-in-out infinite; }
.pai-robot.m-listen .r-sonar { opacity: 1; animation: prSonar 1.8s ease-out infinite; }
.pai-robot.m-listen .r-sonar.s2 { animation-delay: 0.6s; }
.pai-robot.m-listen .r-sonar.s3 { animation-delay: 1.2s; }

/* ── scan: pupils dart, scan-line sweeps visor, antenna blinks ── */
.pai-robot.m-scan .r-pupils { animation: prPupilScan 2.4s ease-in-out infinite; }
.pai-robot.m-scan .r-scan { opacity: 1; animation: prScanline 2.4s ease-in-out infinite; }
.pai-robot.m-scan .r-antenna-dot { animation: prAntBlink 0.9s steps(2) infinite; }

/* ── beat: bounce to the beat + equalizer bars in visor ── */
.pai-robot.m-beat .r-body { animation: prBobBeat 0.62s ease-in-out infinite; }
.pai-robot.m-beat .r-eyes { animation: prEyeGlow 0.62s ease-in-out infinite; }
.pai-robot.m-beat .r-eqbar { opacity: 1; animation: prEqbar 0.62s ease-in-out infinite; }
.pai-robot.m-beat .r-eqbar.b2 { animation-delay: 0.1s; }
.pai-robot.m-beat .r-eqbar.b3 { animation-delay: 0.2s; }
.pai-robot.m-beat .r-eqbar.b4 { animation-delay: 0.3s; }

/* ── think: eyes hide, "..." dots pulse ── */
.pai-robot.m-think .r-body { animation: prBob 5s ease-in-out infinite; }
.pai-robot.m-think .r-eyes { opacity: 0; }
.pai-robot.m-think .r-thinkdot { opacity: 1; animation: prThinkDot 1.2s ease-in-out infinite; }
.pai-robot.m-think .r-thinkdot.d2 { animation-delay: 0.2s; }
.pai-robot.m-think .r-thinkdot.d3 { animation-delay: 0.4s; }

/* ── wake: ring-burst pop-in + quick blink ── */
.pai-robot.m-wake .r-body { animation: prWakePop 0.9s cubic-bezier(.2,.9,.3,1.2) both, prBob 4s ease-in-out 0.9s infinite; }
.pai-robot.m-wake .r-eye-l,
.pai-robot.m-wake .r-eye-r { animation: prBlinkFast 3s ease-in-out 1s infinite; }
.pai-robot.m-wake .r-burst { opacity: 1; animation: prBurst 0.9s ease-out both; }

@keyframes prBob { 0%,100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-4px) rotate(-0.6deg); } }
@keyframes prBobBeat { 0%,100% { transform: translateY(0) scale(1); } 8% { transform: translateY(-7px) scale(1.03,0.97); } 20% { transform: translateY(0) scale(0.99,1.02); } 50% { transform: translateY(-2px); } }
@keyframes prBlink { 0%,92%,100% { transform: scaleY(1); } 96% { transform: scaleY(0.08); } }
@keyframes prBlinkFast { 0%,88%,100% { transform: scaleY(1); } 92%,96% { transform: scaleY(0.1); } 94% { transform: scaleY(1); } }
@keyframes prEyeGlow { 0%,100% { filter: drop-shadow(0 0 3px var(--accent)) drop-shadow(0 0 7px var(--accent-soft)); } 50% { filter: drop-shadow(0 0 7px var(--accent)) drop-shadow(0 0 16px var(--accent)); } }
@keyframes prPupilScan { 0%,100% { transform: translateX(-3.2px); } 50% { transform: translateX(3.2px); } }
@keyframes prAntBlink { 0%,100% { opacity: 1; } 50% { opacity: 0.25; } }
@keyframes prSonar { 0% { transform: scale(0.5); opacity: 0.9; } 100% { transform: scale(1.9); opacity: 0; } }
@keyframes prScanline { 0% { transform: translateY(-7px); opacity: 0; } 20%,80% { opacity: 0.9; } 100% { transform: translateY(8px); opacity: 0; } }
@keyframes prEqbar { 0%,100% { transform: scaleY(0.3); } 50% { transform: scaleY(1); } }
@keyframes prThinkDot { 0%,100% { opacity: 0.25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-2px); } }
@keyframes prWakePop { 0% { transform: scale(0.2) translateY(14px); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } 80% { transform: scale(0.97); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
@keyframes prBurst { 0% { transform: scale(0.4); opacity: 0.8; } 100% { transform: scale(2.1); opacity: 0; } }

/* ══════════════════════════════════════════════════════════════
   Launcher AI badge + click animation
══════════════════════════════════════════════════════════════ */
.pai-launcher__glyph {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pai-launcher__badge {
  position: absolute;
  z-index: 2;
  top: -5px; right: -5px;
  padding: 2px 6px;
  border-radius: 8px;
  background: var(--pai-accent);
  color: #000;
  font-family: var(--pai-mono);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;
  box-shadow: 0 0 10px color-mix(in srgb, var(--pai-accent) 70%, transparent);
  animation: paiBadgePulse 2.4s ease-in-out infinite;
}
@keyframes paiBadgePulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 10px color-mix(in srgb, var(--pai-accent) 70%, transparent); }
  50% { transform: scale(1.12); box-shadow: 0 0 16px color-mix(in srgb, var(--pai-accent) 95%, transparent); }
}
/* click/open animation */
.pai-launcher:active { transform: scale(0.9) !important; }
.pai-launcher[data-open="true"] .pai-launcher__glyph { animation: paiLauncherSpin 0.4s cubic-bezier(.2,.7,.3,1); }
@keyframes paiLauncherSpin {
  from { transform: rotate(-90deg) scale(0.7); opacity: 0.4; }
  to { transform: rotate(0) scale(1); opacity: 1; }
}

/* ══════════════════════════════════════════════════════════════
   Product cards
══════════════════════════════════════════════════════════════ */
.pai-products {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.pai-product {
  display: flex;
  gap: 10px;
  padding: 8px;
  border: 1px solid color-mix(in srgb, var(--pai-accent) 26%, transparent);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  text-decoration: none;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
  animation: paiMessageIn 0.3s ease both;
}
.pai-product:hover {
  border-color: var(--pai-accent);
  background: color-mix(in srgb, var(--pai-accent) 8%, transparent);
  transform: translateY(-1px);
}
.pai-product__media {
  width: 60px; height: 60px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.pai-product__media img { width: 100%; height: 100%; object-fit: cover; }
.pai-product__noimg {
  font-family: var(--pai-mono);
  font-size: 8px;
  color: var(--pai-muted);
  letter-spacing: 0.1em;
}
.pai-product__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}
.pai-product__title {
  color: var(--pai-text);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-decoration: none;
}
.pai-product__title:hover { color: var(--pai-accent); }
.pai-product__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.pai-product__price {
  color: var(--pai-accent);
  font-weight: 800;
  font-size: 13px;
  white-space: nowrap;
}
.pai-product__cta {
  color: var(--pai-muted);
  font-size: 10px;
  font-family: var(--pai-mono);
  white-space: nowrap;
  text-decoration: none;
}
.pai-product:hover .pai-product__cta { color: var(--pai-accent); }
.pai-product__oos {
  font-size: 9px;
  color: #ff9f43;
  font-family: var(--pai-mono);
}
.pai-product__buy {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}
#pai-widget-root .pai-buy {
  flex: 1;
  appearance: none;
  border: 1px solid var(--pai-accent);
  background: var(--pai-accent);
  color: #000;
  font-weight: 700;
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: filter 0.15s ease, opacity 0.15s ease;
}
#pai-widget-root .pai-buy:hover { filter: brightness(1.08); }
#pai-widget-root .pai-buy:disabled { opacity: 0.6; cursor: default; }
#pai-widget-root .pai-buy--done {
  background: transparent;
  color: var(--pai-accent);
}
#pai-widget-root .pai-buy--error {
  background: transparent;
  color: #ff9f43;
  border-color: #ff9f43;
}
#pai-widget-root .pai-buy__cart {
  font-size: 10px;
  font-family: var(--pai-mono);
  color: var(--pai-muted);
  text-decoration: underline;
  white-space: nowrap;
}

/* ══════════════════════════════════════════════════════════════
   Lead form (redesigned with prefill context)
══════════════════════════════════════════════════════════════ */
.pai-lead-form__head {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.pai-lead-form__head-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.pai-lead-form__close {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  margin: -2px -2px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--pai-accent) 35%, transparent);
  border-radius: 7px;
  background: transparent;
  color: var(--pai-accent);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.pai-lead-form__close:hover {
  background: color-mix(in srgb, var(--pai-accent) 14%, transparent);
  box-shadow: 0 0 10px color-mix(in srgb, var(--pai-accent) 45%, transparent);
}
.pai-lead-form__head strong {
  color: var(--pai-accent);
  font-size: 13px;
  font-weight: 700;
  text-shadow: 0 0 8px color-mix(in srgb, var(--pai-accent) 50%, transparent);
}
.pai-lead-form__head span {
  color: var(--pai-muted);
  font-size: 11px;
  line-height: 1.35;
}
.pai-lead-form__context {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: baseline;
  padding: 7px 10px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--pai-accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--pai-accent) 24%, transparent);
  font-size: 11px;
  color: var(--pai-text);
}
.pai-lead-form__context-label {
  color: var(--pai-accent);
  font-family: var(--pai-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.pai-lead-input {
  width: 100%;
  min-height: 36px;
  border: 1px solid color-mix(in srgb, var(--pai-accent) 24%, transparent);
  border-radius: 8px;
  background: #000;
  color: var(--pai-text);
  padding: 8px 11px;
  font-size: 13px;
  transition: border-color 0.16s ease;
}
.pai-lead-input:focus { outline: none; border-color: var(--pai-accent); }
.pai-lead-input::placeholder { color: var(--pai-muted); }
.pai-lead-submit {
  width: 100%;
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  background: var(--pai-accent);
  color: #000;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  transition: filter 0.16s ease, transform 0.12s ease;
}
.pai-lead-submit:hover { filter: brightness(1.08); }
.pai-lead-submit:active { transform: scale(0.98); }

.pai-product__old {
  display: block;
  font-size: 10px;
  color: var(--pai-muted);
  font-weight: 400;
  text-decoration: line-through;
  opacity: 0.7;
}

.pai-compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: 4px;
}
.pai-compare-table th,
.pai-compare-table td {
  padding: 6px 8px;
  border: 1px solid rgba(255,255,255,0.12);
  vertical-align: top;
  line-height: 1.4;
}
.pai-compare-table thead th {
  background: rgba(255,255,255,0.06);
  font-weight: 700;
  font-size: 11px;
  color: var(--pai-accent);
  text-align: left;
}
.pai-compare-table thead th:first-child {
  color: var(--pai-muted);
}
.pai-compare-table td:first-child {
  color: var(--pai-muted);
  font-size: 11px;
  white-space: nowrap;
}
.pai-compare-table tbody tr:nth-child(even) td {
  background: rgba(255,255,255,0.03);
}

/* ── Structured comparison (client-rendered, card-style) ───────── */
.pai-compare {
  margin-top: 10px;
  animation: paiMessageIn 0.3s ease both;
}
.pai-compare__scroll {
  overflow-x: auto;
  border: 1px solid color-mix(in srgb, var(--pai-accent) 26%, transparent);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  -webkit-overflow-scrolling: touch;
}
.pai-compare__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.pai-compare__table th,
.pai-compare__table td {
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
  line-height: 1.4;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}
.pai-compare__table tr > *:last-child { border-right: 0; }
.pai-compare__table tbody tr:last-child > * { border-bottom: 0; }

/* header row = product names */
.pai-compare__head {
  font-weight: 800;
  font-size: 11.5px;
  color: var(--pai-accent);
  background: color-mix(in srgb, var(--pai-accent) 12%, transparent);
  min-width: 116px;
  max-width: 160px;
}
.pai-compare__head a {
  color: var(--pai-accent);
  text-decoration: none;
}
.pai-compare__head a:hover { text-decoration: underline; }

/* sticky first column (spec names) so it stays visible while scrolling */
.pai-compare__corner,
.pai-compare__param {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #14141a;
  color: var(--pai-muted);
  font-weight: 600;
  font-size: 11px;
  white-space: nowrap;
}
.pai-compare__corner {
  background: color-mix(in srgb, var(--pai-accent) 12%, #14141a);
}
.pai-compare__table tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.025);
}
.pai-compare__table tbody td {
  color: var(--pai-text);
  font-weight: 600;
}
