#laserworks-ai-chat-root {
  --lw-ai-black: #111111;
  --lw-ai-white: #ffffff;
  --lw-ai-orange: #f28c28;
  --lw-ai-red: #d81920;
  --lw-ai-red-dark: #8f1117;
  --lw-ai-gray: #f4f4f4;
  --lw-ai-border: #e5e5e5;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  position: relative;
  z-index: 2147483000;
}

.lw-ai-chat-button {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: auto;
  min-width: 196px;
  height: 64px;
  padding: 8px 16px 8px 9px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff4b2b 0%, var(--lw-ai-red) 46%, var(--lw-ai-red-dark) 100%);
  color: var(--lw-ai-white);
  box-shadow: 0 14px 34px rgba(120, 12, 18, 0.35), 0 4px 12px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  z-index: 2147483001;
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
  transform-origin: right bottom;
}

.lw-ai-chat-button:hover,
.lw-ai-chat-button:focus-visible {
  transform: scale(1.04);
  box-shadow: 0 18px 42px rgba(120, 12, 18, 0.42), 0 6px 16px rgba(0, 0, 0, 0.22);
  filter: saturate(1.05);
  outline: none;
}

.lw-ai-chat-button.is-open {
  transform: scale(0.98);
}

.lw-chat-launcher-avatar {
  position: relative;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--lw-ai-white);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.12), 0 5px 12px rgba(0, 0, 0, 0.18);
}

.lw-chat-launcher-antenna {
  position: absolute;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--lw-ai-red);
}

.lw-chat-launcher-antenna::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 8px;
  width: 2px;
  height: 7px;
  background: var(--lw-ai-red);
}

.lw-chat-launcher-face {
  position: relative;
  width: 31px;
  height: 24px;
  margin-top: 8px;
  border-radius: 9px;
  background: #181818;
}

.lw-chat-launcher-face::before,
.lw-chat-launcher-face::after {
  content: "";
  position: absolute;
  top: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 7px rgba(255, 255, 255, 0.72);
}

.lw-chat-launcher-face::before {
  left: 7px;
}

.lw-chat-launcher-face::after {
  right: 7px;
}

.lw-chat-launcher-status {
  position: absolute;
  right: 1px;
  bottom: 4px;
  width: 12px;
  height: 12px;
  border: 2px solid var(--lw-ai-white);
  border-radius: 50%;
  background: #21c65b;
  box-shadow: 0 0 0 2px rgba(33, 198, 91, 0.16);
}

.lw-chat-launcher-text {
  display: grid;
  gap: 1px;
  min-width: 0;
  text-align: left;
  line-height: 1.15;
}

.lw-chat-launcher-title {
  display: block;
  color: var(--lw-ai-white);
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
}

.lw-chat-launcher-subtitle {
  display: block;
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.lw-chat-launcher {
  -webkit-tap-highlight-color: transparent;
}

.lw-chat-launcher:active {
  transform: scale(0.99);
}

.lw-chat-launcher-avatar::after {
  content: "AI";
  position: absolute;
  right: -4px;
  top: -2px;
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--lw-ai-orange);
  color: var(--lw-ai-black);
  font-weight: 800;
  font-size: 10px;
  line-height: 1;
}

.lw-ai-chat-panel {
  position: fixed;
  right: 20px;
  bottom: 96px;
  width: min(410px, calc(100vw - 32px));
  height: min(720px, calc(100vh - 124px));
  background: var(--lw-ai-white);
  border: 1px solid var(--lw-ai-border);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(17, 17, 17, 0.22), 0 8px 24px rgba(17, 17, 17, 0.12);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(120px, 1fr) auto;
}

.lw-ai-chat-panel[hidden] {
  display: none;
}

.lw-ai-chat-header {
  flex: 0 0 auto;
  position: relative;
  z-index: 4;
  background: var(--lw-ai-black);
  color: var(--lw-ai-white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
}

.lw-ai-chat-title {
  font-size: 15px;
  font-weight: 700;
}

.lw-ai-chat-close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: var(--lw-ai-white);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.lw-ai-chat-messages {
  overflow-y: auto;
  padding: 20px 18px;
  background: #f7f7f8;
  min-height: 120px;
  max-height: none;
}

.lw-ai-chat-message {
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
}

.lw-ai-chat-message-user {
  align-items: flex-end;
}

.lw-ai-chat-message-assistant {
  align-items: flex-start;
}

.lw-ai-chat-bubble {
  max-width: 90%;
  white-space: pre-wrap;
  line-height: 1.7;
  font-size: 14px;
  border-radius: 16px;
  padding: 12px 14px;
  color: var(--lw-ai-black);
  background: var(--lw-ai-white);
  border: 1px solid var(--lw-ai-border);
  box-shadow: 0 2px 8px rgba(17, 17, 17, 0.04);
}

.lw-ai-chat-bubble pre,
.lw-ai-chat-bubble code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

.lw-ai-chat-bubble pre {
  margin: 10px 0;
  padding: 12px;
  overflow-x: auto;
  border-radius: 12px;
  background: #202123;
  color: #f7f7f8;
  white-space: pre;
  line-height: 1.55;
}

.lw-ai-chat-bubble code {
  border-radius: 6px;
  padding: 2px 5px;
  background: rgba(32, 33, 35, 0.08);
  color: inherit;
}

.lw-ai-chat-bubble pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

.lw-ai-chat-message-user .lw-ai-chat-bubble {
  background: #111111;
  border-color: #111111;
  color: var(--lw-ai-white);
  border-bottom-right-radius: 6px;
}

.lw-ai-chat-message-assistant .lw-ai-chat-bubble {
  border-bottom-left-radius: 6px;
}

.lw-ai-chat-loading-bubble {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #3f3f46;
}

.lw-ai-chat-loading-text {
  display: inline-block;
}

.lw-ai-chat-loading-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.lw-ai-chat-loading-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--lw-ai-red);
  animation: lw-ai-chat-dot 1.05s infinite ease-in-out;
}

.lw-ai-chat-loading-dots span:nth-child(2) {
  animation-delay: 0.14s;
}

.lw-ai-chat-loading-dots span:nth-child(3) {
  animation-delay: 0.28s;
}

@keyframes lw-ai-chat-dot {
  0%,
  80%,
  100% {
    opacity: 0.32;
    transform: translateY(0);
  }

  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.lw-ai-chat-refs {
  max-width: 88%;
  margin-top: 6px;
  padding: 8px 10px;
  background: var(--lw-ai-white);
  border: 1px solid var(--lw-ai-border);
  border-radius: 8px;
}

.lw-ai-chat-refs-title {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 4px;
}

.lw-ai-chat-debug {
  flex: 0 0 auto;
  border-top: 1px solid var(--lw-ai-border);
  background: #181818;
  color: var(--lw-ai-white);
}

.lw-ai-chat-debug-summary {
  cursor: pointer;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 800;
  color: #ffd2a2;
}

.lw-ai-chat-debug-output {
  max-height: 150px;
  overflow: auto;
  margin: 0;
  padding: 0 12px 10px;
  white-space: pre-wrap;
  font-size: 11px;
  line-height: 1.45;
  color: var(--lw-ai-white);
  background: #181818;
}

.lw-ai-chat-ref {
  display: block;
  color: #9a4c00;
  font-size: 12px;
  line-height: 1.45;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.lw-ai-chat-ref:hover {
  text-decoration: underline;
}

.lw-ai-chat-form {
  position: relative;
  z-index: 6;
  display: block;
  flex: 0 0 auto;
  min-height: 119px;
  padding: 16px 84px 16px 16px;
  border-top: 1px solid var(--lw-ai-border);
  border-radius: 20px 20px 0 0;
  background: #f3f4f6;
}

.lw-ai-chat-input {
  display: block;
  width: 100%;
  resize: none;
  min-height: 86px;
  height: 86px;
  max-height: 150px;
  border: 1px solid #e4e4e7;
  border-radius: 16px;
  padding: 14px 16px;
  font: inherit;
  line-height: 1.45;
  background: var(--lw-ai-white);
  box-shadow: inset 0 1px 2px rgba(17, 17, 17, 0.03);
  box-sizing: border-box;
  overflow-y: auto;
}

.lw-ai-chat-input:focus {
  border-color: #ff7a59;
  background: var(--lw-ai-white);
  box-shadow: 0 0 0 3px rgba(216, 25, 32, 0.12);
  outline: none;
}

.lw-ai-chat-submit {
  position: absolute;
  right: 16px;
  bottom: 16px;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: linear-gradient(135deg, #ff4b2b 0%, var(--lw-ai-red) 58%, var(--lw-ai-red-dark) 100%);
  color: var(--lw-ai-white);
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(216, 25, 32, 0.28);
  transition: transform 140ms ease, box-shadow 140ms ease, filter 140ms ease;
}

.lw-ai-chat-submit:hover,
.lw-ai-chat-submit:focus-visible {
  transform: scale(1.06);
  box-shadow: 0 11px 22px rgba(216, 25, 32, 0.34);
  filter: saturate(1.05);
  outline: none;
}

.lw-ai-chat-send-icon {
  position: relative;
  display: block;
  width: 21px;
  height: 21px;
  transform: rotate(-18deg);
}

.lw-ai-chat-send-icon::before {
  content: "";
  position: absolute;
  inset: 1px 0 0 1px;
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 18px solid var(--lw-ai-white);
}

.lw-ai-chat-send-icon::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 8px;
  width: 9px;
  height: 2px;
  background: rgba(216, 25, 32, 0.86);
  transform: rotate(10deg);
  transform-origin: left center;
}

.lw-ai-chat-submit:disabled,
.lw-ai-chat-input:disabled {
  opacity: 0.65;
  cursor: wait;
}

@media (max-width: 520px) {
  .lw-ai-chat-button {
    right: 14px;
    bottom: 14px;
    width: 62px;
    min-width: 62px;
    height: 62px;
    padding: 7px;
    border-radius: 50%;
    justify-content: center;
  }

  .lw-chat-launcher-text {
    display: none;
  }

  .lw-ai-chat-panel {
    right: 10px;
    left: 10px;
    bottom: 86px;
    width: auto;
    height: min(720px, calc(100vh - 104px));
    border-radius: 16px;
  }

  .lw-ai-chat-messages {
    padding: 16px 12px;
  }

  .lw-ai-chat-form {
    padding: 14px 78px 14px 12px;
    border-radius: 18px 18px 0 0;
  }

  .lw-ai-chat-input {
    min-height: 86px;
    height: 86px;
    max-height: 150px;
    padding: 13px 14px;
  }

  .lw-ai-chat-submit {
    right: 12px;
    bottom: 14px;
    width: 56px;
    height: 56px;
  }
}
