/**
 * HMD 聊天组件样式
 */

/* 主容器 */
.hmd-chat-widget {
  position: fixed;
  bottom: 0;
  right: 0;
  z-index: 1000200;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

/* 聊天窗口 */
.hmd-chat-window {
  position: fixed !important;
  width: 540px;
  min-width: 320px;
  max-width: 800px;
  height: min(750px, calc(100vh - 120px));
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  border: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: all 0.3s linear;
  overflow: visible !important;
  clip-path: none;
}

.hmd-chat-widget-open .hmd-chat-window {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* 全屏模式 */
.hmd-chat-widget-fullscreen .hmd-chat-window {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  min-width: 100vw !important;
  border-radius: 0;
}

.hmd-chat-window-transitioning {
  transition: transform 0.3s linear,
              width 0.3s linear,
              height 0.3s linear,
              left 0.3s linear,
              top 0.3s linear,
              border-radius 0.3s linear !important;
}

/* Header */
.hmd-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #e5e7eb;
  background: #3b82f6;
  color: white;
  border-radius: 16px 16px 0 0;
}

.hmd-chat-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hmd-chat-header-icon {
  font-size: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hmd-chat-header-title {
  font-weight: 500;
  font-size: 18px;
}

.hmd-chat-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-shrink: 0;
}

.hmd-chat-header-button {
  padding: 4px;
  background: transparent;
  border: none;
  color: white;
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 0.2s;
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hmd-chat-header-button:hover {
  background: rgba(255, 255, 255, 0.2);
}

.hmd-chat-header-button-icon {
  width: 28px;
  height: 28px;
  padding: 6px;
  flex-shrink: 0;
  min-width: 28px;
}

.hmd-chat-header-button-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.hmd-chat-widget-fullscreen .hmd-chat-header-right {
  gap: 12px;
}

.hmd-chat-widget-fullscreen .hmd-chat-input-area {
  position: relative;
  width: 100%;
  box-sizing: border-box;
}

.hmd-chat-widget-fullscreen .hmd-chat-input-wrapper {
  max-width: 100%;
  width: 100%;
}

.hmd-chat-widget-fullscreen .hmd-chat-send-button {
  position: relative;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
}

/* Messages area */
.hmd-chat-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: rgba(107, 114, 128, 0.4) transparent;
}

.hmd-chat-messages::-webkit-scrollbar { width: 6px; }
.hmd-chat-messages::-webkit-scrollbar-track { background: transparent; }
.hmd-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(107, 114, 128, 0.4);
  border-radius: 3px;
}
.hmd-chat-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(75, 85, 99, 0.6);
}

/* Empty state */
.hmd-chat-empty {
  text-align: center;
  color: #6b7280;
  padding: 32px 16px;
}

.hmd-chat-empty-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }
.hmd-chat-empty-text { font-size: 14px; margin-bottom: 4px; }
.hmd-chat-empty-subtext { font-size: 12px; color: #9ca3af; }

/* Message */
.hmd-chat-message {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.hmd-chat-message-user { justify-content: flex-end; }
.hmd-chat-message-assistant { justify-content: flex-start; }

/* Avatar */
.hmd-chat-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
  padding: 4px;
  box-sizing: border-box;
  overflow: hidden;
  position: relative;
}

.hmd-chat-avatar-img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
.hmd-chat-avatar svg { width: 100%; height: 100%; display: block; }
.hmd-chat-avatar-bot { background: rgba(59, 130, 246, 0.1); }
.hmd-chat-avatar-user { background: #3b82f6; color: white; }

/* Bubble */
.hmd-chat-bubble {
  max-width: min(76%, 520px);
  border-radius: 16px;
  padding: 10px 16px;
}

.hmd-chat-bubble-user { background: #3b82f6; color: white; border-bottom-right-radius: 4px; }
.hmd-chat-bubble-assistant { background: #f3f4f6; color: #1f2937; border-bottom-left-radius: 4px; }

/* Content */
.hmd-chat-content { font-size: 13px; white-space: pre-wrap; word-wrap: break-word; }
.hmd-chat-content strong { font-weight: 600; }
.hmd-chat-content em { font-style: italic; }
.hmd-chat-content code {
  background: rgba(0, 0, 0, 0.1);
  padding: 2px 4px;
  border-radius: 4px;
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 0.9em;
}
.hmd-chat-bubble-user .hmd-chat-content code { background: rgba(255, 255, 255, 0.2); }

/* Loading */
.hmd-chat-loading { display: flex; align-items: center; gap: 8px; }

.hmd-chat-loading-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #e5e7eb;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: hmd-spin 0.6s linear infinite;
}

@keyframes hmd-spin { to { transform: rotate(360deg); } }

/* Tracking form */
.hmd-chat-tracking-form { margin-top: 12px; }
.hmd-chat-tracking-message { font-size: 13px; margin-bottom: 8px; }

.hmd-chat-tracking-form-inner {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.hmd-chat-tracking-input {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  font-size: 14px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: white;
  outline: none;
}

.hmd-chat-tracking-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.hmd-chat-tracking-button {
  padding: 8px;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
}

.hmd-chat-tracking-button:hover { background: #2563eb; }
.hmd-chat-tracking-button svg { width: 20px; height: 20px; stroke: currentColor; }

/* Tracking result */
.hmd-chat-tracking-result {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
}

.hmd-chat-tracking-loading {
  background: #f9fafb;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #6b7280;
}

.hmd-chat-tracking-loading-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #e5e7eb;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: hmd-spin 0.6s linear infinite;
}

.hmd-chat-tracking-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 12px;
  padding: 12px;
}

.hmd-chat-tracking-error-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hmd-chat-tracking-error-message {
  flex: 1;
  margin: 0;
  font-size: 14px;
  color: #dc2626;
  line-height: 1.5;
  min-width: 0;
}

.hmd-chat-tracking-retry-button {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: white;
  background: #dc2626;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.hmd-chat-tracking-retry-button:hover { background: #b91c1c; }
.hmd-chat-tracking-retry-button:active { background: #991b1b; }
.hmd-chat-tracking-retry-button:disabled { opacity: 0.5; cursor: not-allowed; }

.hmd-chat-tracking-retry-icon {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hmd-chat-tracking-success { background: #f9fafb; }

.hmd-chat-tracking-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 0;
}

.hmd-chat-tracking-carrier {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
}

.hmd-chat-tracking-separator { color: #9ca3af; }

.hmd-chat-tracking-number {
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 12px;
  color: #374151;
}

.hmd-chat-tracking-status {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 500;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: #dbeafe;
  color: #1e40af;
  opacity: 0;
  transition: opacity 0.5s ease-in;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.hmd-chat-tracking-status-fade-in { opacity: 1; }
.hmd-chat-tracking-status-loading { background: #f3f4f6; color: #6b7280; opacity: 1; white-space: nowrap; }

.hmd-chat-tracking-status-spinner {
  animation: hmd-spin 1s linear infinite;
  flex-shrink: 0;
}

.hmd-chat-tracking-status-delivered { background: #dcfce7; color: #166534; }
.hmd-chat-tracking-status-exception { background: #fee2e2; color: #991b1b; }
.hmd-chat-tracking-status-out-for-delivery { background: #e9d5ff; color: #6b21a8; }
.hmd-chat-tracking-status-pickup { background: #dbeafe; color: #1e40af; }
.hmd-chat-tracking-status-in-transit { background: #dbeafe; color: #1e40af; }

.hmd-chat-tracking-summary {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
}

.hmd-chat-tracking-summary-content {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px;
  background: #dbeafe;
  border-radius: 8px;
}

.hmd-chat-tracking-summary-icon { width: 16px; height: 16px; color: #2563eb; flex-shrink: 0; margin-top: 2px; }

.hmd-chat-tracking-summary-text {
  flex: 1;
  margin: 0;
  font-size: 12px;
  color: #1e40af;
  line-height: 1.6;
  word-wrap: break-word;
}

.hmd-chat-tracking-events {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hmd-chat-tracking-events:first-child { margin-top: 0; padding-top: 0; border-top: none; }

.hmd-chat-tracking-event { display: flex; align-items: flex-start; gap: 8px; padding: 0; margin: 0; }

.hmd-chat-tracking-event-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d1d5db;
  flex-shrink: 0;
  margin-top: 6px;
  align-self: flex-start;
}

.hmd-chat-tracking-event-dot-active { background: #1f2937; width: 8px; height: 8px; }

.hmd-chat-tracking-event-content { flex: 1; min-width: 0; }

.hmd-chat-tracking-event-desc {
  font-size: 14px;
  font-weight: 500;
  color: #1f2937;
  word-wrap: break-word;
  line-height: 1.5;
  margin: 0; padding: 0;
}

.hmd-chat-tracking-event-time {
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
  line-height: 1.4;
  margin-bottom: 0; padding: 0;
  font-weight: normal;
}

.hmd-chat-tracking-footer {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.hmd-chat-tracking-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  color: #3b82f6;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s;
}

.hmd-chat-tracking-toggle:hover { color: #2563eb; }
.hmd-chat-tracking-toggle-text { color: inherit; }
.hmd-chat-tracking-toggle-icon { width: 12px; height: 12px; color: inherit; flex-shrink: 0; }
.hmd-chat-tracking-toggle-count { color: #9ca3af; font-weight: normal; }

.hmd-chat-tracking-link {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  color: #3b82f6;
  text-decoration: none;
  transition: color 0.2s;
}

.hmd-chat-tracking-link:hover { color: #2563eb; text-decoration: underline; }
.hmd-chat-tracking-link-icon { width: 12px; height: 12px; flex-shrink: 0; }

/* Relevant FAQs */
.hmd-chat-relevant-faqs {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
}

.hmd-chat-relevant-faqs-title {
  padding-top: 0px !important;
  margin-block-start: 0px !important;
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 8px;
}

.hmd-chat-relevant-faqs-list { display: flex; flex-wrap: wrap; gap: 8px; }

.hmd-chat-relevant-faq-item {
  font-size: 12px;
  padding: 4px 8px;
  background: #e5e7eb;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s;
  color: #1f2937;
  text-align: left;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hmd-chat-relevant-faq-item:hover { background: #d1d5db; }

/* Input area */
.hmd-chat-input-area {
  padding: 12px;
  border-top: 1px solid #e5e7eb;
  flex-shrink: 0;
  min-height: 64px;
  box-sizing: border-box;
  border-radius: 0 0 16px 16px;
}

.hmd-chat-input-wrapper {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  width: 100%;
  box-sizing: border-box;
}

.hmd-chat-input {
  flex: 1;
  min-width: 0;
  min-height: 42px;
  max-height: 120px;
  padding: 10px 16px;
  font-size: 13px;
  border: 1px solid #9ca3af;
  border-radius: 14px;
  background: #f9fafb;
  outline: none;
  resize: none;
  overflow-y: auto;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.hmd-chat-input:hover { border-color: #6b7280; }
.hmd-chat-input:focus {
  border-color: transparent;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  background: white;
}

.hmd-chat-send-button {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  border-radius: 50%;
  background: #3b82f6;
  color: white;
  border: none;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
  flex-shrink: 0;
  position: relative;
}

.hmd-chat-send-button:hover { background: #2563eb; }
.hmd-chat-send-button:disabled { opacity: 0.5; cursor: not-allowed; }

/* Toggle button */
.hmd-chat-toggle-button {
  position: fixed;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #3b82f6;
  color: white;
  border: none;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s, box-shadow 0.2s, transform 0.2s;
  z-index: 1000100;
}

.hmd-chat-toggle-button:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  transform: scale(1.05);
}

.hmd-chat-widget-open .hmd-chat-toggle-button { transform: none; }
.hmd-chat-widget-open .hmd-chat-toggle-button:hover { transform: scale(1.05); }

/* 拖动调整宽度的手柄 */
.hmd-chat-resize-handle {
  position: absolute;
  top: 16px;
  bottom: 16px;
  left: -4px;
  width: 4px;
  cursor: ew-resize;
  background: transparent;
  z-index: 10000;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: auto !important;
  border-radius: 0 2px 2px 0;
}

.hmd-chat-resize-handle::before {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  background: rgba(156, 163, 175, 0.6);
  border-radius: 1px;
  opacity: 0;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.hmd-chat-resize-handle:hover {
  left: -6px;
  width: 6px;
  background: rgba(59, 130, 246, 0.2);
  border-radius: 0 3px 3px 0;
}

.hmd-chat-resize-handle:hover::before {
  opacity: 1;
  width: 3px;
  background: rgba(59, 130, 246, 0.8);
  box-shadow: 0 0 4px rgba(59, 130, 246, 0.4);
}

.hmd-chat-resize-handle:active {
  left: -7px;
  width: 7px;
  background: rgba(59, 130, 246, 0.3);
  border-radius: 0 4px 4px 0;
}

.hmd-chat-resize-handle:active::before {
  opacity: 1;
  width: 4px;
  background: rgba(59, 130, 246, 1);
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.6);
}

.hmd-chat-widget-fullscreen .hmd-chat-resize-handle { display: none; }

/* 聊天按钮图标图片 */
.hmd-chat-toggle-button img { width: 24px; height: 24px; object-fit: contain; }

/* 确认弹窗 */
.hmd-chat-window {
  position: relative;
  z-index: 1000101;
}

.hmd-chat-confirm-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.2s ease;
  backdrop-filter: blur(2px);
  border-radius: 16px;
}

.hmd-chat-confirm-overlay-visible { opacity: 1; }

.hmd-chat-confirm-dialog {
  background: white;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05);
  width: calc(100% - 48px);
  max-width: 320px;
  margin: 0 auto;
  overflow: hidden;
  transform: scale(0.9) translateY(-10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  opacity: 0;
}

.hmd-chat-confirm-overlay-visible .hmd-chat-confirm-dialog {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.hmd-chat-confirm-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 16px 12px;
}

.hmd-chat-confirm-icon {
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: rgba(255, 193, 7, 0.1);
  border-radius: 8px;
}

.hmd-chat-confirm-title { font-size: 16px; font-weight: 600; color: #1f2937; margin: 0; letter-spacing: -0.02em; }

.hmd-chat-confirm-content { padding: 0px 20px 10px 20px; flex: 1; overflow-y: auto; }

.hmd-chat-confirm-message { font-size: 13px; line-height: 1.6; color: #374151; margin: 0; font-weight: 400; letter-spacing: -0.01em; }

.hmd-chat-confirm-actions {
  display: flex;
  gap: 8px;
  padding: 12px 16px 16px;
  justify-content: flex-end;
}

.hmd-chat-confirm-button {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  min-width: 70px;
  letter-spacing: -0.01em;
  position: relative;
  overflow: hidden;
}

.hmd-chat-confirm-button::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 0; height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.3s, height 0.3s;
}

.hmd-chat-confirm-button:hover::before { width: 300px; height: 300px; }

.hmd-chat-confirm-button-cancel { background: #f3f4f6; color: #374151; }
.hmd-chat-confirm-button-cancel:hover { background: #e5e7eb; color: #1f2937; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); }

.hmd-chat-confirm-button-confirm {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.hmd-chat-confirm-button-confirm:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
}

.hmd-chat-confirm-button:active { transform: translateY(0) scale(0.98); }
.hmd-chat-confirm-button:focus { outline: none; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2); }

/* Dark mode */
.hmd-chat-widget-dark .hmd-chat-window { background: #1f2937; border-color: #374151; }
.hmd-chat-widget-dark .hmd-chat-header { background: #1e40af; border-bottom-color: #374151; }
.hmd-chat-widget-dark .hmd-chat-bubble-assistant { background: #374151; color: #f3f4f6; }
.hmd-chat-widget-dark .hmd-chat-messages { background: #1f2937; }
.hmd-chat-widget-dark .hmd-chat-input-area { border-top-color: #374151; background: #1f2937; }
.hmd-chat-widget-dark .hmd-chat-input { background: #374151; border-color: #4b5563; color: #f3f4f6; }
.hmd-chat-widget-dark .hmd-chat-input:hover { border-color: #6b7280; }
.hmd-chat-widget-dark .hmd-chat-input::placeholder { color: #9ca3af; }
.hmd-chat-widget-dark .hmd-chat-input:focus { background: #4b5563; border-color: transparent; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2); }
.hmd-chat-widget-dark .hmd-chat-tracking-result { background: #374151; border-color: #4b5563; }
.hmd-chat-widget-dark .hmd-chat-tracking-number { color: #d1d5db; }
.hmd-chat-widget-dark .hmd-chat-empty { color: #9ca3af; }
.hmd-chat-widget-dark .hmd-chat-empty-subtext { color: #6b7280; }
.hmd-chat-widget-dark .hmd-chat-tracking-message { color: #f3f4f6; }
.hmd-chat-widget-dark .hmd-chat-tracking-carrier { color: #9ca3af; }
.hmd-chat-widget-dark .hmd-chat-tracking-event-desc { color: #f3f4f6; }
.hmd-chat-widget-dark .hmd-chat-tracking-event-time { color: #9ca3af; }
.hmd-chat-widget-dark .hmd-chat-tracking-loading { background: #374151; color: #d1d5db; }
.hmd-chat-widget-dark .hmd-chat-tracking-success { background: #374151; }
.hmd-chat-widget-dark .hmd-chat-tracking-events { border-top-color: #4b5563; }
.hmd-chat-widget-dark .hmd-chat-tracking-footer { border-top-color: #4b5563; }
.hmd-chat-widget-dark .hmd-chat-relevant-faqs { border-top-color: #4b5563; }
.hmd-chat-widget-dark .hmd-chat-relevant-faqs-title { color: #9ca3af; }
.hmd-chat-widget-dark .hmd-chat-relevant-faq-item { background: #4b5563; color: #f3f4f6; }
.hmd-chat-widget-dark .hmd-chat-relevant-faq-item:hover { background: #6b7280; }
.hmd-chat-widget-dark .hmd-chat-content code { background: rgba(255, 255, 255, 0.1); color: #f3f4f6; }
.hmd-chat-widget-dark .hmd-chat-tracking-form { color: #f3f4f6; }
.hmd-chat-widget-dark .hmd-chat-tracking-input { background: #4b5563; border-color: #6b7280; color: #f3f4f6; }
.hmd-chat-widget-dark .hmd-chat-tracking-input::placeholder { color: #9ca3af; }
.hmd-chat-widget-dark .hmd-chat-tracking-input:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2); background: #52525b; }
.hmd-chat-widget-dark .hmd-chat-loading-spinner { border-color: #4b5563; border-top-color: #60a5fa; }
.hmd-chat-widget-dark .hmd-chat-tracking-loading-spinner { border-color: #4b5563; border-top-color: #60a5fa; }
.hmd-chat-widget-dark .hmd-chat-avatar-bot { color: white; background: rgba(59, 130, 246, 0.2); }
.hmd-chat-widget-dark .hmd-chat-tracking-status { background: #1e40af; color: #dbeafe; }
.hmd-chat-widget-dark .hmd-chat-tracking-status-delivered { background: #166534; color: #dcfce7; }
.hmd-chat-widget-dark .hmd-chat-tracking-status-exception { background: #991b1b; color: #fee2e2; }
.hmd-chat-widget-dark .hmd-chat-tracking-status-out-for-delivery { background: #6b21a8; color: #e9d5ff; }
.hmd-chat-widget-dark .hmd-chat-tracking-status-pickup { background: #1e40af; color: #dbeafe; }
.hmd-chat-widget-dark .hmd-chat-tracking-status-in-transit { background: #1e40af; color: #dbeafe; }
.hmd-chat-widget-dark .hmd-chat-tracking-status-loading { background: #374151; color: #9ca3af; }
.hmd-chat-widget-dark .hmd-chat-tracking-event-dot-active { background: #f3f4f6; }
.hmd-chat-widget-dark .hmd-chat-tracking-toggle { color: #60a5fa; }
.hmd-chat-widget-dark .hmd-chat-tracking-toggle:hover { color: #93c5fd; }
.hmd-chat-widget-dark .hmd-chat-tracking-link { color: #60a5fa; }
.hmd-chat-widget-dark .hmd-chat-tracking-link:hover { color: #93c5fd; }
.hmd-chat-widget-dark .hmd-chat-tracking-summary { border-top-color: #4b5563; }
.hmd-chat-widget-dark .hmd-chat-tracking-summary-content { background: rgba(30, 64, 175, 0.2); }
.hmd-chat-widget-dark .hmd-chat-tracking-summary-icon { color: #60a5fa; }
.hmd-chat-widget-dark .hmd-chat-tracking-summary-text { color: #dbeafe; }
.hmd-chat-widget-dark .hmd-chat-tracking-error { background: rgba(220, 38, 38, 0.1); border-color: rgba(220, 38, 38, 0.3); }
.hmd-chat-widget-dark .hmd-chat-tracking-error-message { color: #fca5a5; }
.hmd-chat-widget-dark .hmd-chat-tracking-retry-button { background: #dc2626; color: white; }
.hmd-chat-widget-dark .hmd-chat-tracking-retry-button:hover { background: #b91c1c; }
.hmd-chat-widget-dark .hmd-chat-tracking-retry-button:active { background: #991b1b; }
.hmd-chat-widget-dark .hmd-chat-confirm-dialog { background: #1f2937; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05); }
.hmd-chat-widget-dark .hmd-chat-confirm-icon { background: rgba(255, 193, 7, 0.15); }
.hmd-chat-widget-dark .hmd-chat-confirm-title { color: #f9fafb; }
.hmd-chat-widget-dark .hmd-chat-confirm-message { color: #d1d5db; }
.hmd-chat-widget-dark .hmd-chat-confirm-button-cancel { background: #374151; color: #f3f4f6; }
.hmd-chat-widget-dark .hmd-chat-confirm-button-cancel:hover { background: #4b5563; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); }

/* Responsive */
@media (max-width: 640px) {
  .hmd-chat-window {
    width: calc(100vw - 32px) !important;
    min-width: calc(100vw - 32px) !important;
    max-width: calc(100vw - 32px) !important;
    right: 16px;
    bottom: 80px;
    height: calc(100vh - 100px);
  }

  .hmd-chat-resize-handle { display: none; }

  .hmd-chat-input-area { padding: 10px; min-height: 60px; }

  .hmd-chat-send-button {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    flex-shrink: 0;
  }

  .hmd-chat-confirm-dialog {
    width: calc(100vw - 32px);
    max-width: calc(100vw - 32px);
    margin: 16px;
  }
}
