.lpk-chat {
  bottom: 24px;
  font-family: "Inter", Arial, sans-serif;
  overflow: visible;
  position: fixed;
  right: 28px;
  z-index: 80;
}

.lpk-chat-launcher {
  align-items: center;
  background: rgba(255, 253, 250, 0.96);
  border: 1px solid rgba(179, 138, 61, 0.38);
  border-radius: 999px;
  box-shadow: 0 12px 28px rgba(46, 39, 30, 0.16);
  color: #31483b;
  cursor: grab;
  display: inline-flex;
  gap: 9px;
  min-height: 48px;
  padding: 6px 16px 6px 8px;
  position: relative;
  touch-action: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
  width: auto;
}

.lpk-chat.is-dragging .lpk-chat-launcher {
  cursor: grabbing;
  transform: none;
}

.lpk-chat-launcher:hover {
  border-color: rgba(49, 72, 59, 0.42);
  box-shadow: 0 16px 34px rgba(46, 39, 30, 0.2);
  transform: translateY(-2px);
}

.lpk-chat-launcher-icon {
  align-items: center;
  background: #f7f4ee;
  border: 1px solid #ded7ca;
  border-radius: 999px;
  display: inline-flex;
  height: 36px;
  justify-content: center;
  width: 36px;
}

.lpk-chat-launcher-icon svg {
  fill: none;
  height: 21px;
  stroke: #7b3f35;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  width: 21px;
}

.lpk-chat-launcher-text {
  color: #5b3a2f;
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.lpk-chat-unread {
  align-items: center;
  background: #9d5e46;
  border: 2px solid #fffdfa;
  border-radius: 999px;
  color: #fffdfa;
  display: inline-flex;
  font-size: 0;
  height: 14px;
  justify-content: center;
  position: absolute;
  right: 16%;
  top: 1px;
  width: 14px;
}

.lpk-chat-panel {
  background: #fffdfa;
  border: 1px solid #ded7ca;
  border-radius: 8px;
  bottom: calc(100% + 14px);
  box-shadow: 0 24px 60px rgba(46, 39, 30, 0.2);
  display: grid;
  grid-template-rows: auto minmax(220px, 380px) auto auto;
  max-height: min(680px, calc(100vh - 132px));
  overflow: hidden;
  position: absolute;
  right: 0;
  width: min(390px, calc(100vw - 28px));
}

.lpk-chat.is-near-left .lpk-chat-panel {
  left: 0;
  right: auto;
}

.lpk-chat-panel[hidden] {
  display: none;
}

.lpk-chat-header {
  align-items: center;
  background: #31483b;
  color: #fffdfa;
  display: flex;
  justify-content: space-between;
  padding: 16px 18px;
}

.lpk-chat-header p {
  color: rgba(255, 253, 250, 0.72);
  font-size: 12px;
  font-weight: 800;
  margin: 0 0 3px;
  text-transform: uppercase;
}

.lpk-chat-header strong {
  display: block;
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: 22px;
}

.lpk-chat-header button {
  background: rgba(255, 253, 250, 0.12);
  border: 1px solid rgba(255, 253, 250, 0.16);
  border-radius: 999px;
  color: #fffdfa;
  cursor: pointer;
  font-size: 24px;
  height: 38px;
  line-height: 1;
  width: 38px;
}

.lpk-chat-body {
  background: #f7f4ee;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding: 16px;
}

.lpk-chat-empty {
  background: #fffdfa;
  border: 1px solid #ded7ca;
  border-radius: 8px;
  color: #6c6861;
  line-height: 1.55;
  margin: auto 0;
  padding: 18px;
}

.lpk-chat-empty strong {
  color: #20201d;
  display: block;
  margin-bottom: 6px;
}

.lpk-chat-empty p {
  margin: 0;
}

.lpk-chat-message {
  display: grid;
  gap: 5px;
  max-width: 82%;
}

.lpk-chat-message p {
  border-radius: 8px;
  line-height: 1.48;
  margin: 0;
  padding: 11px 13px;
  word-break: break-word;
}

.lpk-chat-image-link {
  display: block;
}

.lpk-chat-image-link img {
  border: 1px solid #ded7ca;
  border-radius: 8px;
  max-height: 190px;
  max-width: min(240px, 100%);
  object-fit: cover;
}

.lpk-chat-message time {
  color: #8a857b;
  font-size: 11px;
}

.lpk-chat-message.is-customer {
  align-self: flex-end;
}

.lpk-chat-message.is-customer p {
  background: #31483b;
  color: #fffdfa;
}

.lpk-chat-message.is-customer time {
  text-align: right;
}

.lpk-chat-message.is-admin {
  align-self: flex-start;
}

.lpk-chat-message.is-admin p {
  background: #fffdfa;
  border: 1px solid #ded7ca;
  color: #20201d;
}

.lpk-chat-form {
  background: #fffdfa;
  border-top: 1px solid #ded7ca;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 12px;
}

.lpk-chat-upload-row {
  align-items: center;
  display: flex;
  gap: 8px;
  grid-column: 1 / -1;
  min-width: 0;
}

.lpk-chat-attach {
  background: #f7f4ee;
  border: 1px solid #ded7ca;
  border-radius: 999px;
  color: #5b3a2f;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  min-height: 30px;
  padding: 0 12px;
}

.lpk-chat-attach:disabled {
  cursor: wait;
  opacity: 0.64;
}

.lpk-chat-file-chip {
  align-items: center;
  background: #fffdfa;
  border: 1px solid #ded7ca;
  border-radius: 999px;
  color: #6c6861;
  display: inline-flex;
  font-size: 12px;
  gap: 6px;
  max-width: 118px;
  min-height: 30px;
  min-width: 0;
  padding: 0 4px 0 10px;
}

.lpk-chat-file-chip[hidden] {
  display: none;
}

.lpk-chat-file-chip span {
  color: #6c6861;
  font-size: 12px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lpk-chat-file-chip button {
  align-items: center;
  background: #efe7dc;
  border: 0;
  border-radius: 999px;
  color: #5b3a2f;
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 20px;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  height: 20px;
  justify-content: center;
  line-height: 1;
  min-width: 20px;
  padding: 0;
}

.lpk-chat-file-chip button:hover {
  background: #e2d5c4;
}

.lpk-chat-upload-row small {
  color: #8a8175;
  font-size: 11px;
  margin-left: auto;
  white-space: nowrap;
}

.lpk-chat-form textarea {
  background: #f7f4ee;
  border: 1px solid #ded7ca;
  border-radius: 8px;
  color: #20201d;
  font: inherit;
  min-height: 46px;
  padding: 11px 12px;
  resize: none;
}

.lpk-chat-form button {
  background: #31483b;
  border: 0;
  border-radius: 999px;
  color: #fffdfa;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  min-width: 74px;
  padding: 0 18px;
}

.lpk-chat-form button:disabled {
  cursor: wait;
  opacity: 0.64;
}

.lpk-chat-note {
  background: #fffdfa;
  color: #6c6861;
  font-size: 12px;
  margin: 0;
  padding: 0 14px 13px;
}

@media (max-width: 640px) {
  .lpk-chat {
    bottom: 86px;
    right: 16px;
  }

  .lpk-chat-launcher {
    min-height: 44px;
    padding: 5px 13px 5px 7px;
  }

  .lpk-chat-launcher-icon {
    height: 32px;
    width: 32px;
  }

  .lpk-chat-launcher-text {
    font-size: 15px;
  }

  .lpk-chat-panel {
    bottom: calc(100% + 10px);
    grid-template-rows: auto minmax(210px, 1fr) auto auto;
    max-height: calc(100vh - 172px);
    right: -2px;
    width: calc(100vw - 24px);
  }

  .lpk-chat.is-near-left .lpk-chat-panel {
    left: 0;
    right: auto;
  }

  .lpk-chat-header strong {
    font-size: 20px;
  }
}
