#paintChatbot,
#paintChatbot * {
  box-sizing: border-box;
}

#paintChatbot {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 99999;
  font-family: Arial, Helvetica, sans-serif;
  color: #17202a;
}

.npc-launcher {
  width: 72px;
  height: 72px;
  border: 0;
  border-radius: 50%;
  background: #e10a18;
  color: #fff;
  box-shadow: 0 18px 38px rgba(23, 32, 42, 0.28);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.npc-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 46px rgba(23, 32, 42, 0.34);
}

.npc-launcher i {
  font-size: 30px;
}

.npc-launcher-label {
  position: absolute;
  right: 84px;
  bottom: 16px;
  background: #17202a;
  color: #fff;
  border-radius: 6px;
  padding: 8px 11px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 12px 24px rgba(23, 32, 42, 0.18);
}

.npc-panel {
  width: min(440px, calc(100vw - 28px));
  height: min(690px, calc(100vh - 36px));
  display: none;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(17, 24, 39, 0.28);
}

#paintChatbot.is-open .npc-panel {
  display: flex;
}

#paintChatbot.is-open .npc-launcher,
#paintChatbot.is-open .npc-launcher-label {
  display: none;
}

#paintChatbot.is-minimized .npc-panel {
  height: 72px;
}

#paintChatbot.is-minimized .npc-body,
#paintChatbot.is-minimized .npc-composer,
#paintChatbot.is-minimized .npc-statusbar {
  display: none;
}

#paintChatbot.is-maximized .npc-panel {
  width: min(900px, calc(100vw - 36px));
  height: min(780px, calc(100vh - 36px));
}

.npc-header {
  min-height: 72px;
  background: #17202a;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
}

.npc-logo {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  background: #fff;
  object-fit: contain;
  padding: 4px;
  flex: 0 0 44px;
}

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

.npc-title strong,
.npc-title span {
  display: block;
  line-height: 1.2;
}

.npc-title strong {
  font-size: 15px;
  letter-spacing: 0;
}

.npc-title span {
  color: #d7dce5;
  font-size: 12px;
  margin-top: 3px;
}

.npc-header-actions {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
}

.npc-icon-btn {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
}

.npc-icon-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.npc-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #f5f6f8;
}

.npc-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.npc-message {
  max-width: 92%;
  border-radius: 8px;
  padding: 11px 12px;
  font-size: 14px;
  line-height: 1.45;
  box-shadow: 0 6px 18px rgba(17, 24, 39, 0.06);
}

.npc-message.bot {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #e5e7eb;
}

.npc-message.user {
  align-self: flex-end;
  color: #fff;
  background: #253142;
}

.npc-message.system {
  align-self: center;
  color: #5f6b7a;
  background: transparent;
  box-shadow: none;
  padding: 3px 8px;
  font-size: 12px;
}

.npc-message img.npc-preview {
  width: 100%;
  max-height: 210px;
  object-fit: contain;
  display: block;
  border-radius: 6px;
  background: #eef1f5;
  margin-top: 8px;
}

.npc-welcome {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 13px;
  box-shadow: 0 6px 18px rgba(17, 24, 39, 0.06);
}

.npc-welcome strong {
  display: block;
  font-size: 15px;
  margin-bottom: 4px;
}

.npc-welcome p {
  margin: 0 0 10px;
  color: #5f6b7a;
  line-height: 1.45;
}

.npc-quick-actions,
.npc-card-actions,
.npc-download-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.npc-chip,
.npc-action,
.npc-secondary-action {
  border: 1px solid #d7dce5;
  border-radius: 6px;
  background: #fff;
  color: #253142;
  min-height: 34px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.npc-chip:hover,
.npc-action:hover,
.npc-secondary-action:hover {
  color: #e10a18;
  border-color: #e10a18;
}

.npc-primary-action {
  border: 1px solid #e10a18;
  border-radius: 6px;
  background: #e10a18;
  color: #fff;
  min-height: 34px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.npc-primary-action:hover {
  background: #bd0712;
  color: #fff;
}

.npc-swatches {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.npc-swatch {
  overflow: hidden;
  border: 1px solid #dfe3ea;
  border-radius: 6px;
  background: #fff;
}

.npc-swatch-color {
  height: 42px;
}

.npc-swatch span {
  display: block;
  padding: 6px;
  color: #394455;
  font-size: 11px;
  overflow-wrap: anywhere;
}

.npc-products {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.npc-product-card {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 10px;
  border: 1px solid #e2e6ed;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  padding: 8px;
}

.npc-product-media {
  width: 84px;
  height: 96px;
  border-radius: 6px;
  background: #f1f3f6;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.npc-product-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.npc-product-body h4 {
  font-size: 14px;
  line-height: 1.25;
  margin: 0 0 4px;
  color: #17202a;
}

.npc-product-body p {
  margin: 0 0 7px;
  color: #5f6b7a;
  font-size: 12px;
  line-height: 1.35;
}

.npc-product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
}

.npc-product-meta span {
  border-radius: 6px;
  background: #f0f2f5;
  color: #3c4655;
  padding: 4px 6px;
  font-size: 11px;
  font-weight: 700;
}

.npc-price {
  color: #0f8b4c;
  font-weight: 900;
}

.npc-typing {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.npc-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9aa4b2;
  animation: npcPulse 0.9s infinite ease-in-out;
}

.npc-typing span:nth-child(2) {
  animation-delay: 0.12s;
}

.npc-typing span:nth-child(3) {
  animation-delay: 0.24s;
}

@keyframes npcPulse {
  0%, 80%, 100% { opacity: 0.35; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

.npc-form {
  display: grid;
  gap: 8px;
}

.npc-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.npc-field {
  display: grid;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: #344054;
}

.npc-field input,
.npc-field select,
.npc-field textarea,
.npc-composer textarea {
  width: 100%;
  border: 1px solid #cfd6e1;
  border-radius: 6px;
  padding: 9px 10px;
  font: inherit;
  color: #17202a;
  background: #fff;
  outline: none;
}

.npc-field textarea {
  min-height: 70px;
  resize: vertical;
}

.npc-field input:focus,
.npc-field select:focus,
.npc-field textarea:focus,
.npc-composer textarea:focus {
  border-color: #e10a18;
  box-shadow: 0 0 0 2px rgba(225, 10, 24, 0.12);
}

.npc-result {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.npc-result div {
  background: #f7f9fc;
  border: 1px solid #e7ebf1;
  border-radius: 6px;
  padding: 9px;
}

.npc-result span {
  display: block;
  color: #667085;
  font-size: 11px;
}

.npc-result b {
  display: block;
  color: #17202a;
  font-size: 16px;
  margin-top: 2px;
}

.npc-quote-lines {
  display: grid;
  gap: 7px;
}

.npc-quote-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px;
  gap: 8px;
  align-items: center;
  background: #f7f9fc;
  border: 1px solid #e7ebf1;
  border-radius: 6px;
  padding: 8px;
}

.npc-quote-line strong {
  display: block;
  font-size: 12px;
  line-height: 1.25;
}

.npc-quote-line input {
  height: 34px;
}

.npc-statusbar {
  border-top: 1px solid #e5e7eb;
  background: #fff;
  color: #667085;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  padding: 8px 12px;
  font-size: 11px;
}

.npc-composer {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 42px;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border-top: 1px solid #e5e7eb;
  background: #fff;
}

.npc-composer textarea {
  min-height: 42px;
  max-height: 110px;
  resize: none;
}

.npc-composer .npc-icon-btn {
  background: #f2f4f7;
  color: #253142;
  border-color: #d7dce5;
}

.npc-composer .npc-icon-btn:hover {
  background: #e8ebf0;
}

.npc-composer .npc-send {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 6px;
  background: #e10a18;
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.npc-composer .npc-send:hover {
  background: #bd0712;
}

.npc-muted {
  color: #667085;
}

.npc-hidden {
  display: none !important;
}

@media (max-width: 640px) {
  #paintChatbot {
    inset: auto 0 0 auto;
    right: 0;
    bottom: 0;
  }

  .npc-launcher {
    position: fixed;
    right: 16px;
    bottom: 16px;
  }

  .npc-launcher-label {
    display: none;
  }

  .npc-panel,
  #paintChatbot.is-maximized .npc-panel {
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
    border: 0;
  }

  #paintChatbot.is-open .npc-panel {
    display: flex;
  }

  .npc-message {
    max-width: 96%;
  }

  .npc-form-grid,
  .npc-result {
    grid-template-columns: 1fr;
  }

  .npc-product-card {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .npc-product-media {
    width: 72px;
    height: 86px;
  }
}
