/* Source Messenger: Inter, 30px primary header, cream pane, compact rail/composer. */
.sfn-chat {
  --chat-primary: #0c29ab;
  --chat-alert: #1e6df6;
  --chat-cream: #fff0c7;
  position: fixed;
  z-index: 120;
  right: 20px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  width: 360px;
  min-width: 360px;
  height: 423px;
  border-radius: 8px;
  background: var(--chat-cream);
  color: #1a1a1a;
  box-shadow: 0 3px 10px #0005;
  font:
    16px Inter,
    Arial,
    sans-serif;
  overflow: visible;
}
.sfn-chat *,
.sfn-chat *::before,
.sfn-chat *::after {
  box-sizing: border-box;
}
.sfn-chat-fullscreen {
  inset: 0;
  width: 100%;
  min-width: 360px;
  height: 100dvh;
  border-radius: 0;
}
.sfn-chat button,
.sfn-chat input {
  font-family: inherit;
}
.sfn-chat button {
  cursor: pointer;
}
.sfn-chat button:disabled {
  cursor: default;
  opacity: 0.45;
}
.sfn-chat button:focus-visible,
.sfn-chat a:focus-visible,
.sfn-chat input:focus-visible,
.sfn-chat [tabindex]:focus-visible {
  outline: 2px solid #0c29ab;
  outline-offset: -2px;
}
.sfn-chat-header {
  flex: 0 0 30px;
  min-height: 30px;
  display: flex;
  align-items: center;
  gap: 3px;
  background: var(--chat-primary);
  color: #fff;
  border-radius: 8px 8px 0 0;
  cursor: move;
  touch-action: none;
  user-select: none;
}
.sfn-chat-fullscreen .sfn-chat-header {
  border-radius: 0;
  cursor: default;
}
.sfn-chat-header strong {
  flex: 1;
  text-align: center;
  font-size: 18px;
  line-height: 30px;
}
.sfn-chat .sfn-chat-tool {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  min-height: 0;
  padding: 1px;
  margin: 0 2px;
  border: 0;
  border-radius: 5px;
  color: #fff;
  background: var(--chat-alert);
}
.sfn-chat .sfn-chat-tool:disabled {
  opacity: 1;
  cursor: help;
}
.sfn-chat svg {
  width: 25px;
  height: 25px;
  fill: currentColor;
  display: block;
}
.sfn-chat-main {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.sfn-chat-conversations {
  flex: 0 0 110px;
  width: 110px;
  border-right: 2px solid #89816d;
  padding: 0;
  overflow-y: auto;
}
.sfn-chat-fullscreen .sfn-chat-conversations {
  flex-basis: 180px;
  width: 180px;
}
.sfn-chat-conversation {
  position: relative;
  margin: 5px 5px 8px;
  min-height: 38px;
  border-radius: 5px;
  box-shadow: 1px 2px 3px #0004;
  background: #f9d2cc;
  padding: 3px 2px;
}
.sfn-chat-conversation-vendor {
  background: #eaf3ff;
}
.sfn-chat-conversation-po {
  background: #e3ecff;
}
.sfn-chat-conversation.is-selected {
  box-shadow: inset 1px 2px 3px #0005;
}
.sfn-chat .sfn-chat-conversation > button:first-child {
  display: block;
  width: 100%;
  min-height: 30px;
  padding: 2px 4px;
  white-space: normal;
  overflow-wrap: anywhere;
  border: 0;
  background: transparent;
  color: #1a1a1a;
  font-size: 14px;
  font-weight: 400;
}
.sfn-chat
  .sfn-chat-conversation:not(.sfn-chat-conversation-vendor)
  > button:first-child {
  padding-top: 8px;
}
.sfn-chat .sfn-chat-unfollow {
  position: absolute;
  top: -2px;
  right: 1px;
  min-height: 14px;
  padding: 0 2px;
  background: transparent;
  color: #b0200c;
  font-size: 16px;
  line-height: 14px;
  border: 0;
}
.sfn-chat-unread {
  display: block;
  color: #b0200c;
  font-size: 10px;
  font-weight: 700;
  line-height: 10px;
  text-align: right;
  padding: 0 3px;
}
.sfn-chat-messages {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 12px 5px 6px;
  scroll-behavior: auto;
}
.sfn-chat-message {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  position: relative;
  margin: 0 0 10px;
  min-height: 20px;
}
.sfn-chat-message.is-own {
  align-items: flex-end;
}
.sfn-chat-message-meta {
  align-self: center;
  font-size: 10px;
  line-height: 12px;
  margin: 0 0 3px;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.sfn-chat-read {
  color: #697788;
  margin-left: 4px;
}
.sfn-chat-bubble {
  max-width: 90%;
  border: 1px solid #c6c8cc;
  border-radius: 10px;
  background: white;
  padding: 0 5px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 16px;
  line-height: 1.4;
}
.is-own .sfn-chat-bubble {
  background: #dfeafa;
}
.sfn-chat .sfn-chat-delete {
  min-height: 20px;
  padding: 0;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  background: transparent;
  color: #b0200c;
}
.sfn-chat-delete svg {
  width: 20px;
  height: 20px;
}
.sfn-chat-attachment {
  display: flex;
  align-items: center;
  gap: 5px;
  max-width: 90%;
  border: 1px solid #aaa;
  border-radius: 3px;
  padding: 6px;
  margin: 2px 0;
  font-size: 12px;
  background: #fff9;
  color: #0c29ab;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.sfn-chat-attachment svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}
.sfn-chat-pending,
.sfn-chat-unavailable {
  font-size: 11px;
  color: #665a47;
}
.sfn-chat-empty {
  font-size: 12px;
  color: #625b4e;
  text-align: center;
}
.sfn-chat-composer {
  display: flex;
  flex: 0 0 32px;
  width: 100%;
  min-width: 0;
  height: 32px;
  margin: 0;
  padding: 0;
}
.sfn-chat-composer > input {
  flex: 1;
  min-width: 0;
  width: 0;
  min-height: 32px;
  height: 32px;
  border: 2px solid #c6c8cc;
  border-radius: 8px;
  padding: 2px 5px;
  background: #fff;
  font-size: 16px;
}
.sfn-chat-file-button,
.sfn-chat .sfn-chat-send {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex: 0 0 50px;
  width: 50px;
  height: 32px;
  min-height: 32px;
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: var(--chat-alert);
  color: #fff;
  cursor: pointer;
  overflow: hidden;
}
.sfn-chat-file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}
.sfn-chat-file-button:has(input:disabled) {
  opacity: 0.4;
  cursor: default;
}
.sfn-chat-file-button:focus-within {
  outline: 2px solid #0c29ab;
  outline-offset: -2px;
}
.sfn-chat-preview {
  position: absolute;
  z-index: 2;
  bottom: 34px;
  left: 50%;
  transform: translateX(-50%);
  width: 320px;
  max-height: 350px;
  overflow-y: auto;
  padding: 8px;
  border-radius: 5px;
  background: white;
  box-shadow: 0 2px 10px #0006;
}
.sfn-chat-preview-files {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
}
.sfn-chat-preview-file {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.sfn-chat-preview-file > svg {
  flex: 0 0 30px;
}
.sfn-chat-preview-file img {
  display: block;
  max-width: 80px;
  max-height: 90px;
  object-fit: contain;
}
.sfn-chat-preview-file small {
  display: block;
  font-size: 10px;
  color: #626262;
}
.sfn-chat-upload-limit {
  display: block;
  margin: 5px 0;
  font-size: 10px;
  line-height: 1.3;
  color: #626262;
}
.sfn-chat-preview-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.sfn-chat-preview-actions span {
  font-size: 12px;
}
.sfn-chat .sfn-chat-outline {
  background: white;
  border: 1px solid #1e6df6;
  color: #1e6df6;
  min-width: 60px;
  min-height: 30px;
}
.sfn-chat .sfn-chat-primary {
  background: #1e6df6;
  color: #fff;
  min-width: 60px;
  min-height: 30px;
}
.sfn-chat-preview progress {
  display: block;
  width: 100%;
  height: 8px;
  margin: 6px 0;
  accent-color: #1e6df6;
}
.sfn-chat-error,
.sfn-chat-notice {
  flex-shrink: 0;
  padding: 4px 6px;
  max-height: 100px;
  overflow-y: auto;
  background: #fff9;
  font-size: 11px;
  line-height: 1.3;
}
.sfn-chat-error {
  color: #b0200c;
}
.sfn-chat-error button {
  padding: 1px 4px;
  min-height: 18px;
  font-size: 11px;
}
.sfn-chat-notice {
  color: #5b4b19;
}
.sfn-chat-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 600px) {
  .sfn-chat-floating {
    right: 5px;
    bottom: 5px;
  }
  .sfn-chat-fullscreen .sfn-chat-conversations {
    width: 155px;
    flex-basis: 155px;
  }
}
@media print {
  .sfn-chat {
    display: none;
  }
}
