.dt-ai-widget {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.dt-ai-floating-launcher {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 99999;
  border: 0;
  border-radius: 999px;
  background: #111827;
  color: #ffffff;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  pointer-events: auto;
}

.dt-ai-portrait-host {
  position: relative;
  padding: 8px 12px;
  text-align: center;
  background: #f3f4f6;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.dt-ai-assistant-switchers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 8px 12px;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  font-size: 12px;
}

.dt-ai-switcher {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #374151;
}

.dt-ai-switcher select {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  background: #fff;
  max-width: 140px;
}

.dt-ai-lipsync-canvas {
  display: block;
  max-height: 168px;
  width: auto;
  max-width: 100%;
  margin: 0 auto;
  background: transparent;
}

.dt-ai-portrait-wrap {
  position: relative;
  display: inline-block;
  margin: 0 auto;
  --dt-mouth: 0;
}

/* Lip overlay — sits above portrait image */
.dt-ai-lips {
  position: absolute;
  left: 50%;
  bottom: 26%;
  transform: translateX(-50%);
  width: 42%;
  min-width: 36px;
  max-width: 56px;
  height: 14px;
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
}

.dt-ai-portrait-talking .dt-ai-lips {
  opacity: 1;
}

.dt-ai-lip-upper,
.dt-ai-lip-lower {
  display: block;
  width: 100%;
  background: linear-gradient(180deg, #c45c6a 0%, #8b3040 100%);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  transition: transform 0.05s linear, height 0.05s linear;
}

.dt-ai-lip-upper {
  height: 4px;
  transform: scaleX(calc(0.85 + var(--dt-mouth) * 0.2));
}

.dt-ai-lip-lower {
  height: calc(4px + var(--dt-mouth) * 14px);
  transform: scaleX(calc(0.9 + var(--dt-mouth) * 0.25)) translateY(calc(var(--dt-mouth) * 2px));
  border-radius: 40% 40% 45% 45%;
}

.dt-ai-lips-open .dt-ai-lip-upper {
  transform: scaleX(1.05) translateY(1px);
}

/* Jaw + head bob while speaking */
.dt-ai-portrait-talking .dt-ai-portrait-img {
  animation: dt-portrait-jaw 0.22s ease-in-out infinite alternate;
  transform-origin: center 78%;
}

@keyframes dt-portrait-jaw {
  from {
    transform: scale(1) translateY(0);
  }
  to {
    transform: scale(1.03, 1.01) translateY(3px);
  }
}

.dt-ai-portrait-img {
  max-height: 168px;
  width: auto;
  max-width: 100%;
  border-radius: 8px;
  object-fit: contain;
  display: block;
  position: relative;
  z-index: 1;
}

/* Avatar — always proportional, never stretch */
.dt-ai-avatar-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  max-width: 100%;
}

.dt-ai-avatar-frame .dt-ai-lipsync-canvas,
.dt-ai-portrait-host .dt-ai-lipsync-canvas {
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: 168px;
  object-fit: contain;
}

.dt-ai-hero-portrait.dt-ai-avatar-frame {
  min-height: 0;
}

.dt-ai-hero-portrait .dt-ai-lipsync-canvas,
.dt-ai-hero-portrait .dt-ai-portrait-img {
  max-height: 240px;
  object-fit: contain;
}

.dt-ai-portrait-state {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  color: #6b7280;
  margin-top: 4px;
}

.dt-ai-panel {
  position: fixed;
  right: 18px;
  bottom: 72px;
  width: min(380px, calc(100vw - 24px));
  height: min(520px, calc(100vh - 120px));
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  display: none;
  flex-direction: column;
  z-index: 100000;
  pointer-events: auto;
}

.dt-ai-panel.open {
  display: flex;
}

.dt-ai-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  background: #111827;
  color: #ffffff;
  flex-shrink: 0;
}

.dt-ai-header strong {
  font-size: 14px;
}

.dt-ai-close {
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  width: 30px;
  height: 30px;
  cursor: pointer;
}

.dt-ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  background: #f9fafb;
  pointer-events: auto;
}

.dt-ai-msg {
  max-width: 88%;
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.dt-ai-msg-user {
  margin-left: auto;
  background: #111827;
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.dt-ai-msg-assistant {
  margin-right: auto;
  background: #ffffff;
  color: #111827;
  border: 1px solid #e5e7eb;
  border-bottom-left-radius: 4px;
}

.dt-ai-composer {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  padding: 10px;
  border-top: 1px solid #e5e7eb;
  background: #ffffff;
  flex-shrink: 0;
  pointer-events: auto;
}

.dt-ai-input {
  flex: 1;
  min-height: 42px;
  max-height: 120px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.4;
  resize: none;
  font-family: inherit;
  color: #111827;
  background: #ffffff;
  pointer-events: auto;
  -webkit-user-select: text;
  user-select: text;
}

.dt-ai-input:focus {
  outline: 2px solid #5b8def;
  outline-offset: 1px;
  border-color: #5b8def;
}

.dt-ai-input:disabled {
  opacity: 0.7;
  cursor: wait;
}

.dt-ai-send {
  border: 0;
  border-radius: 10px;
  background: #111827;
  color: #ffffff;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}

.dt-ai-send:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.dt-ai-panel.dt-ai-loading .dt-ai-send {
  opacity: 0.7;
}

.dt-ai-hero {
  border: 1px solid #d1d5db;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff, #f9fafb);
  padding: 18px;
  margin: 12px 0;
}

.dt-ai-hero h3 {
  margin: 0 0 8px;
  font-size: 20px;
  line-height: 1.2;
}

.dt-ai-hero p {
  margin: 0 0 14px;
  color: #4b5563;
}

.dt-ai-btn {
  display: inline-block;
  border: 0;
  border-radius: 10px;
  background: #111827;
  color: #ffffff;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.dt-ai-header-actions {
  display: flex;
  gap: 6px;
}

.dt-ai-minimize {
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.dt-ai-logo {
  height: 24px;
  width: auto;
  margin-right: 8px;
}

.dt-ai-drag-handle {
  cursor: move;
}

.dt-ai-panel.dt-ai-minimized {
  height: auto;
  min-height: 0;
}

.dt-ai-panel.dt-ai-minimized .dt-ai-messages,
.dt-ai-panel.dt-ai-minimized .dt-ai-composer,
.dt-ai-panel.dt-ai-minimized .dt-ai-products-host,
.dt-ai-panel.dt-ai-minimized .dt-ai-portrait-host,
.dt-ai-panel.dt-ai-minimized .dt-ai-thinking {
  display: none;
}

.dt-ai-mic {
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #fff;
  width: 42px;
  height: 42px;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 18px;
}

.dt-ai-mic.dt-ai-mic-active {
  background: #fee2e2;
  border-color: #f87171;
  animation: dt-pulse 1s infinite;
}

@keyframes dt-pulse {
  50% { opacity: 0.7; }
}

.dt-ai-thinking {
  padding: 10px 12px;
  background: #f3f4f6;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.dt-ai-thinking[hidden] {
  display: none !important;
}

.dt-ai-thinking-msg {
  margin: 0 0 8px;
  font-size: 13px;
  color: #374151;
}

.dt-ai-progress {
  height: 4px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
}

.dt-ai-progress-bar {
  height: 100%;
  width: 40%;
  background: var(--dt-accent, #111827);
  border-radius: 4px;
  animation: dt-progress-indeterminate 1.2s ease-in-out infinite;
}

@keyframes dt-progress-indeterminate {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(120%); }
  100% { transform: translateX(280%); }
}

.dt-ai-thinking-status {
  margin: 0;
  font-size: 11px;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dt-ai-products-host {
  max-height: 200px;
  overflow-y: auto;
  padding: 0 10px;
  flex-shrink: 0;
  -webkit-overflow-scrolling: touch;
}

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

.dt-ai-product-card {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 8px;
  background: #fff;
  font-size: 12px;
}

.dt-ai-product-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}

.dt-ai-product-img-wrap {
  width: 100%;
  height: 88px;
  border-radius: 6px;
  overflow: hidden;
  background: #f3f4f6;
  margin-bottom: 6px;
}

.dt-ai-product-no-img {
  background: linear-gradient(135deg, #e5e7eb, #f9fafb);
}

.dt-ai-product-card h4 {
  margin: 6px 0 4px;
  font-size: 12px;
  line-height: 1.2;
}

.dt-ai-product-add {
  width: 100%;
  margin-top: 6px;
  border: 0;
  border-radius: 8px;
  background: var(--dt-accent, #111827);
  color: #fff;
  padding: 6px;
  font-size: 11px;
  cursor: pointer;
}

.dt-ai-skeleton {
  height: 80px;
  border-radius: 10px;
  background: linear-gradient(90deg, #f3f4f6, #e5e7eb, #f3f4f6);
  background-size: 200% 100%;
  animation: dt-shimmer 1.2s infinite;
}

@keyframes dt-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.dt-ai-cart-toast {
  margin: 8px 10px;
  padding: 8px 10px;
  background: #ecfdf5;
  border: 1px solid #6ee7b7;
  border-radius: 8px;
  font-size: 12px;
}

.dt-ai-places {
  padding: 8px 12px;
  font-size: 12px;
  border-bottom: 1px solid #e5e7eb;
}

.dt-ai-places ul {
  margin: 0;
  padding-left: 16px;
}

.dt-ai-place-actions a {
  margin-right: 10px;
  font-size: 11px;
}

.dt-ai-hero-enter {
  animation: dt-hero-in 0.5s ease-out;
}

@keyframes dt-hero-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.dt-ai-hero-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
}

.dt-ai-hero-portrait .dt-ai-portrait-img {
  max-height: 240px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.dt-ai-hero-results:empty {
  display: none;
}

.dt-ai-widget.dt-ai-hero-product-mode {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(200px, 280px);
  gap: 16px;
  align-items: start;
}

.dt-ai-widget.dt-ai-hero-product-mode .dt-ai-hero-slider {
  display: none;
}

.dt-ai-widget.dt-ai-hero-product-mode .dt-ai-hero-results {
  display: block;
  max-height: min(420px, 50vh);
  overflow-y: auto;
  margin-top: 0;
  padding: 8px 0;
  grid-column: 1;
  grid-row: 1;
}

.dt-ai-widget.dt-ai-hero-product-mode .dt-ai-panel-hero-inline {
  grid-column: 2;
  grid-row: 1;
  position: relative !important;
  right: auto !important;
  bottom: auto !important;
  width: 100%;
  height: min(480px, 60vh);
  display: flex !important;
}

.dt-ai-widget.dt-ai-hero-product-mode > .dt-ai-hero {
  display: contents;
}

.dt-ai-product-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dt-ai-product-row {
  margin-bottom: 10px;
  cursor: pointer;
}

.dt-ai-product-row-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
}

.dt-ai-product-row:hover .dt-ai-product-row-inner {
  border-color: var(--dt-accent, #111827);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.dt-ai-product-img-wrap {
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  background: #f3f4f6;
}

.dt-ai-product-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.dt-ai-product-row-copy {
  flex: 1;
  min-width: 120px;
}

.dt-ai-product-row-copy h4 {
  margin: 0 0 4px;
  font-size: 14px;
}

.dt-ai-product-snippet {
  margin: 4px 0 0;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.35;
}

.dt-ai-product-view {
  flex: 0 0 auto;
  align-self: center;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.dt-ai-product-detail {
  padding: 8px 0;
}

.dt-ai-product-back {
  border: 0;
  background: transparent;
  color: var(--dt-accent, #111827);
  font-size: 13px;
  cursor: pointer;
  margin-bottom: 8px;
  padding: 0;
}

.dt-ai-product-detail-body h4 {
  margin: 0 0 8px;
  font-size: 16px;
}

.dt-ai-product-detail-img img {
  max-width: 100%;
  max-height: 160px;
  object-fit: contain;
  border-radius: 8px;
}

.dt-ai-product-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  font-size: 12px;
}

.dt-ai-panel-embedded {
  position: relative !important;
  right: auto !important;
  bottom: auto !important;
  width: 100%;
  height: min(520px, 70vh);
  display: flex !important;
  border-radius: 12px;
}

.dt-ai-chatbot-embed {
  margin: 12px 0;
}

.dt-ai-hero-chatbot-slot {
  margin-top: 12px;
}

@media (max-width: 640px) {
  .dt-ai-hero-grid {
    grid-template-columns: 1fr;
  }
  .dt-ai-widget.dt-ai-hero-product-mode {
    grid-template-columns: 1fr;
  }
  .dt-ai-widget.dt-ai-hero-product-mode .dt-ai-panel-hero-inline {
    grid-column: 1;
    height: min(420px, 55vh);
  }
  .dt-ai-product-row-inner {
    flex-direction: column;
  }
  .dt-ai-product-view {
    width: 100%;
  }
  .dt-ai-product-grid {
    grid-template-columns: 1fr;
  }
  .dt-ai-floating-launcher {
    right: 12px;
    bottom: 12px;
  }
  .dt-ai-panel {
    right: 12px;
    left: 12px;
    width: auto;
    bottom: 64px;
    height: min(70vh, 520px);
  }
}

.dt-health-banner {
  margin: 0 0 8px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(180, 83, 9, 0.12);
  border: 1px solid rgba(180, 83, 9, 0.35);
  color: #92400e;
  font-size: 13px;
  line-height: 1.4;
}

.dt-avatar-css-mode {
  position: relative;
}
.dt-avatar-css-mode .dt-css-eyes {
  position: absolute;
  left: 38%;
  top: 34%;
  width: 24%;
  height: 3%;
  border-radius: 999px;
  background: rgba(20, 20, 20, 0.85);
  pointer-events: none;
  z-index: 4;
  transition: transform 0.12s ease, opacity 0.12s ease;
}
.dt-avatar-css-mode .dt-css-mouth {
  position: absolute;
  left: 42%;
  top: 68%;
  width: 16%;
  height: 2%;
  border-radius: 999px;
  background: rgba(120, 50, 45, 0.9);
  pointer-events: none;
  z-index: 4;
  transition: height 0.08s ease, width 0.08s ease;
}
.dt-avatar-css-mode.is-speaking .dt-css-mouth {
  animation: dt-css-mouth-talk 0.14s ease-in-out infinite alternate;
}
.dt-avatar-css-mode.is-blinking .dt-css-eyes {
  transform: scaleY(0.15);
  opacity: 0.35;
}
@keyframes dt-css-mouth-talk {
  from { height: 2%; width: 16%; }
  to { height: 5%; width: 18%; }
}

.dt-ai-customer-settings {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  font-size: 12px;
}
.dt-ai-customer-settings label {
  display: grid;
  gap: 4px;
}
.dt-ai-customer-settings select,
.dt-ai-customer-settings input[type="range"] {
  width: 100%;
}
