:root {
  --primary-color: #007AFF;
  --assistant-bg: #EFEFF4;
  --user-bg: var(--primary-color);
  --background-color: #FFFFFF;
  --header-bg: #F8F8F8;
  --text-primary: #000000;
  --text-secondary: #6D6D72;
  --border-color: #E5E5EA;
  --danger-color: #FF3B30;
}
.message .text {
  white-space: pre-wrap;
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.9)
  }
  to {
    opacity: 1;
    transform: scale(1)
  }
}
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px)
  }
  to {
    opacity: 1;
    transform: translateY(0)
  }
}
@keyframes bounce {
  0%,
  80%,
  100% {
    transform: scale(0)
  }
  40% {
    transform: scale(1.0)
  }
}
.chat-trigger-icon {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 60px;
  height: 60px;
  background: var(--primary-color);
  border-radius: 50%;
  box-shadow: 0 5px 20px rgba(0, 122, 255, .3);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  z-index: 999;
  transition: transform .3s cubic-bezier(.34, 1.56, .64, 1), opacity .3s;
  animation: fadeIn .5s .2s both;
  -webkit-tap-highlight-color: transparent;
}
.chat-trigger-icon:hover {
  transform: scale(1.1)
}
.chat-trigger-icon .chat-icon-inner {
  position: relative;
  width: 32px;
  height: 32px
}
.chat-trigger-icon svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 32px;
  height: 32px;
  color: #fff;
  transition: transform .3s cubic-bezier(.34, 1.56, .64, 1), opacity .2s
}
.chat-icon-close {
  transform: scale(.7) rotate(-90deg);
  opacity: 0
}
.chat-trigger-icon.chat-open .chat-icon-bubble {
  transform: scale(.7) rotate(90deg);
  opacity: 0
}
.chat-trigger-icon.chat-open .chat-icon-close {
  transform: scale(1) rotate(0);
  opacity: 1
}
.chat-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.chat-title-icon {
  width: 20px;
  height: 20px;
  display: block;
  flex: 0 0 20px;
}
.chat-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--header-bg);
  border-top: 1px solid var(--border-color);
}
.order-row {
  display: none;
  padding: 8px 12px;
  background: var(--background-color);
}
.order-row.visible {
  display: flex;
  align-items: center;
}
.order-row .quick-chip {
  border: 1px solid var(--primary-color);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  background: transparent;
  cursor: pointer;
}
.order-row .quick-chip:hover {
  background: rgba(0, 122, 255, .06);
}
.chat-popup-window {
  position: fixed;
  bottom: 95px;
  left: 20px;
  width: 90%;
  max-width: 580px;
  height: 70vh;
  max-height: 850px;
  background: var(--background-color);
  border-radius: 18px;
  z-index: 10002;
  box-shadow: 0 15px 45px rgba(0, 0, 0, .15), 0 2px 5px rgba(0, 0, 0, .08);
  transform: scale(.95) translateY(10px);
  opacity: 0;
  visibility: hidden;
  transition: transform .3s cubic-bezier(.34, 1.56, .64, 1), opacity .2s ease-out;
  display: flex;
  flex-direction: column
}
.chat-popup-window.visible {
  transform: scale(1) translateY(0);
  opacity: 1;
  visibility: visible
}
.chat-header {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  background: var(--header-bg);
  border-radius: 18px 18px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0
}
.chat-header h2 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  color: var(--text-primary)
}
.close-chat-button {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  opacity: .5;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  outline: none;
}
.close-chat-button:focus {
  outline: none;
}
.chat-greeting-video {
  width: 150px;
  height: 150px;
  display: block;
  margin: 0 auto 10px
}
.quick-actions {
  display: none;
  gap: 8px;
  flex-wrap: wrap;
  padding: 6px 12px;
  border-bottom: 1px solid var(--border-color);
  background: #fafafa
}
.quick-chip {
  border: 1px solid var(--primary-color);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  user-select: none
}
.quick-chip:hover {
  background: rgba(0, 122, 255, .06)
}
.chat-messages {
  flex-grow: 1;
  padding: 15px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0
}
.attachments-bar {
  display: none;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 12px;
  border-top: 1px dashed var(--border-color);
  background: #fff
}
.att-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 4px 8px;
  font-size: 12px
}
.att-thumb {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid #eee
}
.att-remove {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  opacity: .6
}
.att-remove:hover {
  opacity: 1
}
.drop-overlay {
  position: absolute;
  inset: 0;
  border: 2px dashed var(--primary-color);
  border-radius: 16px;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 122, 255, .05);
  z-index: 2
}
.drop-overlay.visible {
  display: flex
}
.message {
  display: flex;
  max-width: 85%;
  animation: slideIn .4s cubic-bezier(.16, 1, .3, 1) both
}
.message .text {
  padding: 12px 18px;
  border-radius: 22px;
  line-height: 1.5;
  word-wrap: break-word;
  font-size: 15px
}
.assistant-message {
  align-self: flex-start
}
.assistant-message .text {
  background: #fff;
  border: 1px solid var(--primary-color);
  color: var(--text-primary);
  border-top-left-radius: 8px;
  text-align: left
}
.user-message {
  align-self: flex-end
}
.user-message .text {
  background: var(--user-bg);
  color: #fff;
  border-top-right-radius: 8px
}
.typing-indicator {
  display: flex;
  align-items: center;
  padding: 12px 18px
}
.typing-indicator .dot {
  width: 8px;
  height: 8px;
  margin: 0 2px;
  background: #C6C6C8;
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out both
}
.typing-indicator .dot:nth-child(1) {
  animation-delay: -.32s
}
.typing-indicator .dot:nth-child(2) {
  animation-delay: -.16s
}
.chat-input-form {
  position: relative;
  display: flex;
  align-items: center;
  padding: 12px 15px;
  border-top: 1px solid var(--border-color);
  background: var(--header-bg);
  border-radius: 0 0 18px 18px
}
.input-wrapper {
  position: relative;
  flex-grow: 1;
  display: flex;
  align-items: center
}
.chat-input-form input[name="message"] {
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 12px 96px 12px 44px;
  font-size: 15px;
  outline: none;
  transition: border-color .2s
}
.input-actions {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 8px
}
.input-actions button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: .6
}
.input-actions button:hover {
  opacity: 1
}
.input-actions button svg {
  width: 18px;
  height: 18px;
  color: var(--text-secondary)
}
.hidden-file-input {
  display: none !important;
}
.chat-input-form input[name="message"] {
  padding-left: 44px;
}
.attach-button svg {
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
  display: block;
}
.attach-button:hover {
  opacity: 1;
}
.attach-button {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent!important;
  border: none!important;
  padding: 4px;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: .7;
  z-index: 2;
}
.send-button {
  background: var(--primary-color);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  margin-left: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0
}
.send-button:disabled {
  background: #D1D1D6;
  cursor: not-allowed
}
.chat-confirmation .text {
  background: var(--assistant-bg);
  text-align: center
}
.confirmation-buttons {
  display: flex;
  gap: 10px;
  justify-content: center
}
.confirmation-buttons button {
  border: none;
  padding: 8px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer
}
.confirm-yes {
  background: var(--danger-color);
  color: #fff
}
.confirm-no {
  background: #E5E5EA;
  color: var(--text-primary)
}
.chat-messages .message .text ul {
  margin: 0;
  padding-left: 1.2em;
}
.chat-messages .message .text ul li {
  margin: 0px 0;
  line-height: 1.4;
}
@media (max-width:600px) {
  .chat-trigger-icon {
    width: 48px;
    height: 48px;
    bottom: calc(14px + env(safe-area-inset-bottom));
    left: 14px;
    box-shadow: 0 3px 12px rgba(0, 122, 255, .25);
  }
  .chat-trigger-icon .chat-icon-inner,
  .chat-trigger-icon svg {
    width: 24px;
    height: 24px;
  }
  .chat-popup-window {
    top: auto;
    left: 0;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100vh;
    border-radius: 16px 16px 0 0
  }
  .chat-header,
  .chat-input-form {
    border-radius: 0;
    padding: 5px
  }
  .close-chat-button {
    display: block
  }
  .close-chat-button svg {
    width: 20px;
    height: 20px
  }
  .chat-messages {
    padding: 10px 10px
  }
  .message {
    max-width: 80%
  }
  .message .text {
    padding: 10px 10px;
    border-radius: 20px
  }
  .chat-title-icon {
    width: 18px;
    height: 18px;
  }
  .order-row .quick-chip {
    font-size: 13px;
    padding: 6px 10px;
  }
}
.chat-trigger-icon.chat-open {
  opacity: 0;
  transform: scale(.8);
  display: none;
  pointer-events: none
}
.body-scroll-locked {
  overflow: hidden;
  position: fixed;
  width: 100%
}
.chat-popup-window.visible {
  transform: translateY(0);
  transition: transform .4s cubic-bezier(.25, 1, .5, 1)
}