.ecom-chat-woocommerce-root {
  --ecom-chat-ink: #18222c;
  --ecom-chat-muted: #66737f;
  --ecom-chat-accent: #0a6e68;
  --ecom-chat-accent-dark: #074c49;
  --ecom-chat-paper: #fffdf8;
  --ecom-chat-line: #d9e3df;
  --ecom-chat-edge-gap: 22px;
  /* Keep the default launcher and panel clear of WooCommerce floating-cart controls. */
  --ecom-chat-cart-clearance: 92px;
  position: relative;
  z-index: 99999;
  font-family: Georgia, 'Times New Roman', serif;
  color: var(--ecom-chat-ink);
}

.ecom-chat-launcher {
  position: fixed;
  right: var(--ecom-chat-cart-clearance);
  bottom: var(--ecom-chat-edge-gap);
  border: 0;
  border-radius: 999px;
  padding: 13px 18px;
  background: var(--ecom-chat-accent);
  color: #fff;
  box-shadow: 0 12px 28px rgba(7, 76, 73, .22);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.ecom-chat-launcher:hover,
.ecom-chat-launcher:focus-visible,
.ecom-chat-send:hover,
.ecom-chat-send:focus-visible {
  background: var(--ecom-chat-accent-dark);
}

.ecom-chat-panel {
  position: fixed;
  right: var(--ecom-chat-cart-clearance);
  bottom: calc(var(--ecom-chat-edge-gap) + 56px);
  width: min(380px, calc(100vw - 28px));
  max-height: min(650px, calc(100vh - 112px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--ecom-chat-paper);
  border: 1px solid var(--ecom-chat-line);
  border-radius: 18px;
  box-shadow: 0 18px 55px rgba(24, 34, 44, .2);
}

.ecom-chat-panel.bottom-left,
.ecom-chat-launcher.bottom-left {
  left: var(--ecom-chat-edge-gap);
  right: auto;
}

.ecom-chat-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--ecom-chat-line);
}

.ecom-chat-locale {
  color: var(--ecom-chat-muted);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.ecom-chat-messages {
  flex: 1;
  min-height: 170px;
  overflow-y: auto;
  padding: 15px;
}

.ecom-chat-status {
  margin: 20px 4px;
  color: var(--ecom-chat-muted);
  font-size: 14px;
  line-height: 1.5;
}

.ecom-chat-status-error {
  color: #8c3f2d;
}

.ecom-chat-message {
  max-width: 88%;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--ecom-chat-line);
  border-radius: 12px 12px 12px 3px;
  background: #f3f7f3;
}

.ecom-chat-message.is-customer {
  margin-left: auto;
  border-color: #c5dfda;
  border-radius: 12px 12px 3px 12px;
  background: #e2f0eb;
}

.ecom-chat-message-body {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 15px;
  line-height: 1.45;
}

.ecom-chat-attachments {
  display: grid;
  gap: 7px;
  margin-top: 9px;
}

.ecom-chat-attachment {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  color: var(--ecom-chat-accent-dark);
  font-size: 13px;
  text-decoration: none;
}

.ecom-chat-image-attachment {
  position: relative;
  display: block;
  min-height: 52px;
}

.ecom-chat-image-attachment img {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 9px;
  opacity: 0;
  transition: opacity .18s ease;
}

.ecom-chat-image-attachment.is-loaded img {
  opacity: 1;
}

.ecom-chat-attachment-fallback {
  color: var(--ecom-chat-muted);
  font-size: 12px;
}

.ecom-chat-composer {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--ecom-chat-line);
}

.ecom-chat-composer textarea {
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
  border: 1px solid var(--ecom-chat-line);
  border-radius: 9px;
  padding: 9px;
  background: #fff;
  color: var(--ecom-chat-ink);
  font: inherit;
}

.ecom-chat-composer-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ecom-chat-composer input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.ecom-chat-file-label {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  box-sizing: border-box;
  border: 1px solid var(--ecom-chat-line);
  border-radius: 8px;
  padding: 7px 10px;
  color: var(--ecom-chat-accent-dark);
  cursor: pointer;
  font-size: 12px;
}

.ecom-chat-file-label:hover,
.ecom-chat-file-label:focus-within {
  border-color: var(--ecom-chat-accent);
}

.ecom-chat-file-label.is-disabled {
  cursor: not-allowed;
  opacity: .55;
}

.ecom-chat-send {
  border: 0;
  border-radius: 8px;
  padding: 8px 12px;
  background: var(--ecom-chat-accent);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.ecom-chat-send:disabled,
.ecom-chat-composer textarea:disabled {
  cursor: not-allowed;
  opacity: .55;
}

@media (max-width: 560px) {
  .ecom-chat-woocommerce-root {
    --ecom-chat-edge-gap: 14px;
    --ecom-chat-cart-clearance: 84px;
  }

  .ecom-chat-launcher {
    right: var(--ecom-chat-cart-clearance);
    bottom: var(--ecom-chat-edge-gap);
  }

  .ecom-chat-panel {
    right: var(--ecom-chat-cart-clearance);
    bottom: calc(var(--ecom-chat-edge-gap) + 54px);
    width: calc(100vw - var(--ecom-chat-cart-clearance) - var(--ecom-chat-edge-gap));
    max-height: calc(100vh - 92px);
  }

  .ecom-chat-panel.bottom-left {
    left: var(--ecom-chat-edge-gap);
    right: auto;
    width: calc(100vw - (var(--ecom-chat-edge-gap) * 2));
  }
}

@media (prefers-reduced-motion: reduce) {
  .ecom-chat-image-attachment img {
    transition: none;
  }
}
