.srfq-chat {
  --chat-border: #e5e7eb;
  --chat-muted: #6b7280;
  --chat-bg: #f8fafc;
  --chat-panel: #ffffff;
  --chat-primary: var(--srfq-primary, #2563eb);
  --chat-danger: #dc2626;
  --chat-warning: #f59e0b;
  --srfq-chat-bottom-offset: 0px;
  --srfq-chat-viewport-height: 100dvh;
  background: var(--chat-panel);
  border: 1px solid var(--chat-border);
  border-radius: 18px;
  overflow: hidden;
}

.srfq-chat__layout {
  display: grid;
  grid-template-columns: minmax(320px, 370px) minmax(0, 1fr);
  height: min(860px, calc(100vh - 110px));
  min-height: 620px;
  max-height: 860px;
  background: var(--chat-bg);
  overflow: hidden;
}

.srfq-chat__sidebar {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-left: 1px solid var(--chat-border);
  background: #f8fafc;
}

.srfq-chat__sidebar-head,
.srfq-chat__sidebar-tools,
.srfq-chat__listmeta,
.srfq-chat__sidebar-footer {
  padding: 14px 16px;
}

.srfq-chat__sidebar-head {
  border-bottom: 1px solid var(--chat-border);
  background: #fff;
}

.srfq-chat__sidebar-title {
  font-size: 16px;
  font-weight: 800;
  color: #111827;
}

.srfq-chat__sidebar-subtitle {
  margin-top: 6px;
  color: var(--chat-muted);
  font-size: 12px;
  line-height: 1.8;
}

.srfq-chat__sidebar-tools {
  display: grid;
  gap: 10px;
  border-bottom: 1px solid var(--chat-border);
  background: #f8fafc;
}

.srfq-chat__searchbox {
  display: block;
}

.srfq-chat__searchinput {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  padding: 11px 14px;
  font-size: 13px;
  background: #fff;
  outline: none;
}

.srfq-chat__searchinput:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37,99,235,.08);
}

.srfq-chat__filters {
  display: flex;
  gap: 8px;
  overflow: auto;
  padding-bottom: 2px;
}

.srfq-chat__filter,
.srfq-chat__more,
.srfq-chat__loadolder,
.srfq-chat__action,
.srfq-chat__back,
.srfq-chat__icon,
.srfq-chat__opentab,
.srfq-chat__thread {
  -webkit-tap-highlight-color: transparent;
}

.srfq-chat__filter {
  border: 1px solid #d1d5db;
  background: #fff;
  color: #111827;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.srfq-chat__filter.is-active {
  background: #dbeafe;
  color: #1d4ed8;
  border-color: #bfdbfe;
  font-weight: 700;
}

.srfq-chat__opentabs-wrap {
  display: none;
}

.srfq-chat__listmeta {
  color: #6b7280;
  font-size: 12px;
  border-top: 1px solid var(--chat-border);
  background: #fff;
}

.srfq-chat__threads-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 8px;
}

.srfq-chat__threads-empty {
  margin:8px;
}

.srfq-chat__thread {
  width: 100%;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid transparent;
  background: #fff;
  border-radius: 14px;
  padding: 10px;
  margin-bottom: 8px;
  text-align: right;
  cursor: pointer;
}

.srfq-chat__thread:hover {
  border-color: #dbeafe;
  background: #f8fbff;
}

.srfq-chat__thread.is-active {
  border-color: #93c5fd;
  background: #eff6ff;
}

.srfq-chat__thread.has-unread {
  box-shadow: inset 0 0 0 1px rgba(37,99,235,.18);
}

.srfq-chat__thread.is-closed{
  opacity:1;
  border-color:#fecaca;
  background:linear-gradient(180deg, rgba(254,242,242,.95), rgba(255,255,255,.98));
}

.srfq-chat__thread.is-archived {
  opacity: .94;
  border-color:#cbd5e1;
  background:linear-gradient(180deg, rgba(248,250,252,.96), rgba(255,255,255,.98));
}

.srfq-chat__thread-avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #e0f2fe;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex: 0 0 auto;
}

.srfq-chat__thread-body {
  flex: 1 1 auto;
  min-width: 0;
}

.srfq-chat__thread-top,
.srfq-chat__thread-previewline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.srfq-chat__thread-title {
  font-size: 12px;
  font-weight: 800;
  color: #111827;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.srfq-chat__thread-time,
.srfq-chat__thread-subtitle,
.srfq-chat__thread-preview,
.srfq-chat__thread-tick,
.srfq-chat__thread-unread {
  font-size: 11px;
}

.srfq-chat__thread-subtitle {
  color: #6b7280;
  margin-top: 4px;
  min-height: 18px;
  line-height: 1.7;
}

.srfq-chat__thread-badges {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 5px;
}

.srfq-chat__thread-closed-note {
  margin-top: 8px;
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(239,68,68,.08);
  border: 1px solid rgba(239,68,68,.18);
  color: #b91c1c;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.75;
}

.srfq-chat__thread-closed-note.is-archived {
  background: rgba(148,163,184,.10);
  border-color: rgba(148,163,184,.22);
  color: #475569;
}

.srfq-chat__thread-previewline {
  margin-top: 6px;
}

.srfq-chat__thread-preview {
  color: #4b5563;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.srfq-chat__thread-tick {
  color: #16a34a;
  flex: 0 0 auto;
}

.srfq-chat__thread-unread {
  min-width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--chat-primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  flex: 0 0 auto;
}

.srfq-chat__pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  line-height: 1;
  background: #eef2ff;
  color: #3730a3;
}

.srfq-chat__pill.is-request {
  background: #dbeafe;
  color: #1d4ed8;
}

.srfq-chat__pill.is-quote {
  background: #dcfce7;
  color: #15803d;
}

.srfq-chat__pill.is-archived,
.srfq-chat__pill.is-closed {
  background: #e5e7eb;
  color: #374151;
}

.srfq-chat__sidebar-footer {
  border-top: 1px solid var(--chat-border);
  background: #fff;
}

.srfq-chat__more,
.srfq-chat__loadolder {
  width: 100%;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #0f172a;
  border-radius: 12px;
  padding: 11px 14px;
  font-size: 13px;
  cursor: pointer;
}

.srfq-chat__main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: #fff;
}

.srfq-chat__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--chat-border);
  background: #fff;
}

.srfq-chat__back {
  display: none;
  border: 0;
  background: #eff6ff;
  color: var(--chat-primary);
  border-radius: 12px;
  width: 40px;
  height: 40px;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.srfq-chat__headtext {
  flex: 1 1 auto;
  min-width: 0;
}

.srfq-chat__title {
  font-size: 16px;
  font-weight: 800;
  color: #111827;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.srfq-chat__subtitle {
  font-size: 12px;
  color: #6b7280;
  line-height: 1.8;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.srfq-chat__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.srfq-chat__action {
  border: 0;
  color: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.srfq-chat__action--close {
  background: #64748b;
}

.srfq-chat__action--report {
  background: #ea580c;
}

.srfq-chat__action--block {
  background: var(--chat-danger);
}

.srfq-chat__action:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.srfq-chat__banner,
.srfq-chat__lock,
.srfq-chat__notice {
  padding: 12px 16px;
  font-size: 13px;
  line-height: 1.9;
  border-bottom: 1px solid var(--chat-border);
}

.srfq-chat__banner {
  background: #fff7d6;
  color: #7a5a00;
}

.srfq-chat__lock {
  background: #fee2e2;
  color: #991b1b;
}

.srfq-chat__notice {
  background: #eff6ff;
  color: #1d4ed8;
}

.srfq-chat__summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 10px 14px 12px;
  border-bottom: 1px solid var(--chat-border);
  background: #f8fafc;
  align-items: start;
}

.srfq-chat__summary.is-hidden {
  display: none;
}

.srfq-chat__summary-card {
  border: 1px solid rgba(203,213,225,.7);
  border-radius: 12px;
  background: rgba(255,255,255,.96);
  padding: 8px 10px;
}

.srfq-chat__summary-card--request {
  background: linear-gradient(180deg, rgba(37,99,235,.06) 0, rgba(255,255,255,.98) 100%);
}

.srfq-chat__summary-card--quote {
  background: linear-gradient(180deg, rgba(16,185,129,.07) 0, rgba(255,255,255,.98) 100%);
}

.srfq-chat__summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.srfq-chat__summary-title {
  font-size: 11px;
  font-weight: 800;
  color: #111827;
}

.srfq-chat__summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px 10px;
}

.srfq-chat__kv {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
  padding: 2px 0;
  border-bottom: 1px dotted rgba(203,213,225,.6);
}

.srfq-chat__kv-label {
  display: block;
  color: #64748b;
  font-size: 9px;
  white-space: nowrap;
}

.srfq-chat__kv-value {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  color: #111827;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.6;
  text-align: right;
  direction: rtl;
  word-break: break-word;
}

.srfq-chat__summary-desc {
  margin-top: 4px;
  color: #475569;
  font-size: 10px;
  line-height: 1.75;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.srfq-chat__messages-wrap {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
  background: #fff;
}

.srfq-chat__loadolder {
  margin: 12px 16px 0;
  width: calc(100% - 32px);
}

.srfq-chat__messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 16px 14px;
  background: linear-gradient(180deg, #f8fafc 0, #ffffff 160px);
}

.srfq-chat__empty {
  margin:16px auto;
  max-width:min(100%,680px);
}

.srfq-chat__day {
  display: flex;
  justify-content: center;
  margin: 10px 0 14px;
}

.srfq-chat__day span {
  background: #e5e7eb;
  color: #4b5563;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 11px;
}

.srfq-chat__msg {
  display: flex;
  margin: 0 0 12px;
}

.srfq-chat__msg.is-me {
  justify-content: flex-start;
}

.srfq-chat__msg.is-other {
  justify-content: flex-end;
}

.srfq-chat__bubble {
  max-width: min(84%, 560px);
  padding: 12px 14px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 8px 24px rgba(15,23,42,.04);
  white-space: pre-wrap;
  word-break: break-word;
}

.srfq-chat__msg.is-me .srfq-chat__bubble {
  margin-right: auto;
  background: #dbeafe;
  border-color: #bfdbfe;
}

.srfq-chat__msg.is-other .srfq-chat__bubble {
  margin-left: auto;
}

.srfq-chat__msg.role-supplier.is-me .srfq-chat__bubble {
  background: #dcfce7;
  border-color: #bbf7d0;
}

.srfq-chat__msg.role-admin .srfq-chat__bubble {
  background: #f3f4f6;
}

.srfq-chat__text {
  font-size: 14px;
  line-height: 2;
  color: #111827;
  white-space: pre-wrap;
  word-break: break-word;
}

.srfq-chat__img {
  display: block;
  max-width: 100%;
  border-radius: 14px;
  cursor: zoom-in;
}

.srfq-chat__meta {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
  color: #6b7280;
  font-size: 11px;
  direction: ltr;
}

.srfq-chat__tick.is-read {
  color: #16a34a;
  font-weight: 800;
}

.srfq-chat__composer {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 14px 16px;
  border-top: 1px solid var(--chat-border);
  background: #fff;
}

.srfq-chat__icon {
  border: 1px solid #d1d5db;
  background: #fff;
  border-radius: 12px;
  width: 46px;
  height: 46px;
  font-size: 18px;
  cursor: pointer;
  flex: 0 0 auto;
  margin-inline: 0;
}

.srfq-chat__icon:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.srfq-chat__composer-field {
  flex: 1 1 auto;
  min-width: 0;
}

.srfq-chat__input {
  width: 100%;
  min-height: 46px;
  max-height: 140px;
  resize: none;
  border: 1px solid #d1d5db;
  border-radius: 14px;
  padding: 12px 14px;
  outline: none;
  font-size: 14px;
  line-height: 1.8;
  background: #fff;
}

.srfq-chat__input:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37,99,235,.08);
}

.srfq-chat__send {
  min-width: 92px;
  height: 46px;
  border-radius: 14px;
  font-weight: 800;
  margin-inline: 0;
}

@media (max-width: 1180px) {
  .srfq-chat__summary {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .srfq-chat__layout {
    grid-template-columns: 1fr;
    min-height: 86vh;
  }

  .srfq-chat__sidebar {
    border-left: 0;
    border-bottom: 1px solid var(--chat-border);
  }

  .srfq-chat__back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .srfq-chat__actions {
    gap: 6px;
  }

  .srfq-chat__action {
    padding: 9px 10px;
  }
}

@media (max-width: 720px) {
  .srfq-chat {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .srfq-chat__layout {
    min-height: calc(100vh - 32px);
    max-height: none;
  }

  .srfq-chat__sidebar,
  .srfq-chat__main {
    min-height: 0;
  }

  .srfq-chat__header {
    position: sticky;
    top: 0;
    z-index: 5;
  }

  .srfq-chat__actions {
    width: 100%;
    justify-content: flex-start;
  }

  .srfq-chat__summary {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 8px 12px 10px;
  }

  .srfq-chat__summary-grid {
    grid-template-columns: 1fr 1fr;
  }

  .srfq-chat__thread {
    padding: 11px;
  }

  .srfq-chat__bubble {
    max-width: 92%;
  }

  .srfq-chat__kv-label,
  .srfq-chat__kv-value,
  .srfq-chat__summary-desc {
    font-size: 10px;
  }

  .srfq-chat--mobile-open .srfq-chat__sidebar {
    display: none;
  }

  .srfq-chat:not(.srfq-chat--mobile-open) .srfq-chat__main {
    display: none;
  }

  .srfq-chat__composer {
    position: sticky;
    bottom: 0;
    z-index: 5;
    padding-bottom: max(14px, env(safe-area-inset-bottom));
  }

  .srfq-chat__send {
    min-width: 74px;
  }
}

/* UX refinement pass 2.2.1.171 */
.srfq-chat__searchwrap {
  position: relative;
  display: block;
}

.srfq-chat__searchinput {
  padding-left: 40px;
}

.srfq-chat__searchclear {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: #eef2ff;
  color: #4338ca;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.srfq-chat__overview {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.srfq-chat__overview-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e5e7eb;
  color: #334155;
  font-size: 12px;
}

.srfq-chat__overview-chip strong {
  font-size: 12px;
  color: #0f172a;
}

.srfq-chat__overview-chip.is-search {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.srfq-chat__opentab-unread {
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  padding: 0 6px;
}

.srfq-chat__summary-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px 3px;
  background: #f8fafc;
}

.srfq-chat__summary-toolbar-title {
  font-size: 11px;
  font-weight: 800;
  color: #334155;
}

.srfq-chat__summary-toggle {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #0f172a;
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
}

.srfq-chat__summary.is-collapsed {
  display: none;
}

.srfq-chat__messages-wrap {
  position: relative;
}

.srfq-chat__scrollbottom {
  position: absolute;
  left: 16px;
  bottom: 18px;
  z-index: 3;
  border: 0;
  border-radius: 999px;
  background: #0f172a;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 10px 14px;
  box-shadow: 0 14px 30px rgba(15,23,42,.18);
  cursor: pointer;
}

.srfq-chat__sender {
  display: inline-flex;
  align-items: center;
  margin-bottom: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.75);
  border: 1px solid rgba(148,163,184,.3);
  color: #334155;
  font-size: 11px;
  font-weight: 700;
}

.srfq-chat__composer-meta {
  padding: 10px 16px 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.8;
  background: #fff;
}

.srfq-chat__thread-avatar {
  font-weight: 800;
  font-size: 16px;
  color: #0369a1;
  background: linear-gradient(180deg, #e0f2fe 0, #f8fafc 100%);
}

.srfq-chat__thread.is-active .srfq-chat__thread-avatar {
  color: #1d4ed8;
  background: linear-gradient(180deg, #dbeafe 0, #eff6ff 100%);
}

.srfq-chat__thread-previewline {
  align-items: center;
}

.srfq-chat__thread-preview {
  line-height: 1.7;
}

@media (max-width: 900px) {
  .srfq-chat__overview {
    overflow: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }
}

@media (max-width: 720px) {
  .srfq-chat__summary-toolbar {
    position: sticky;
    top: 61px;
    z-index: 4;
    padding-top: 10px;
  }

  .srfq-chat__scrollbottom {
    left: 12px;
    bottom: 12px;
  }

  .srfq-chat__composer-meta {
    padding: 8px 14px 0;
  }

  .srfq-chat__searchinput {
    padding-left: 36px;
  }

  .srfq-chat__overview-chip {
    white-space: nowrap;
  }

  .srfq-chat__summary-grid {
    gap: 2px 10px;
  }

  .srfq-chat__summary-card {
    padding: 8px 10px;
  }

  .srfq-chat__summary-desc {
    -webkit-line-clamp: 2;
  }
}


.srfq-chat__thread-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3px;
  margin-top: 6px;
}

.srfq-chat__thread-field {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
}

.srfq-chat__thread-label {
  color: #64748b;
  font-size: 10px;
  white-space: nowrap;
}

.srfq-chat__thread-value {
  flex: 1 1 auto;
  min-width: 0;
  color: #0f172a;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.5;
  text-align: right;
  direction: rtl;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.srfq-chat__thread-value--status {
  white-space: normal;
}

.srfq-chat__thread-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 10px;
  line-height: 1.6;
  font-weight: 700;
}

.srfq-chat__thread-status--pending,
.srfq-chat__thread-status--review {
  background: #dbeafe;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.srfq-chat__thread-status--approved {
  background: #dcfce7;
  color: #166534;
  border-color: #bbf7d0;
}

.srfq-chat__thread-status--rejected,
.srfq-chat__thread-status--closed {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fecaca;
}

.srfq-chat__thread-status--default {
  background: #f1f5f9;
  color: #334155;
  border-color: #cbd5e1;
}

.srfq-chat__thread-title {
  font-size: 13px;
}

.srfq-chat__thread-time {
  color: #0f172a;
  font-weight: 700;
}

.srfq-chat__thread-previewline {
  margin-top: 7px;
  padding-top: 6px;
  border-top: 1px dashed rgba(203,213,225,.75);
}

.srfq-chat__thread-party,
.srfq-chat__thread-subtitle {
  display: none;
}

.srfq-chat__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #2563eb;
  background: linear-gradient(180deg, #eff6ff 0, #ffffff 100%);
  border-color: #bfdbfe;
}

.srfq-chat__icon:hover:not(:disabled) {
  background: #dbeafe;
  color: #1d4ed8;
}

.srfq-chat__icon-graphic {
  display: inline-flex;
  width: 22px;
  height: 22px;
}

.srfq-chat__icon-graphic svg {
  width: 100%;
  height: 100%;
  display: block;
}

.srfq-chat__lightbox {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, .82);
  z-index: 999999;
}

.srfq-chat__lightbox.is-open {
  display: flex;
}

.srfq-chat__lightbox-stage {
  max-width: min(92vw, 1100px);
  max-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.srfq-chat__lightbox-img {
  display: block;
  max-width: 100%;
  max-height: 88vh;
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
  background: #fff;
}

.srfq-chat__lightbox-close {
  position: absolute;
  top: 22px;
  left: 22px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,.16);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

html.srfq-chat__noscroll,
html.srfq-chat__noscroll body {
  overflow: hidden !important;
}

@media (max-width: 720px) {
  .srfq-chat__thread-label,
  .srfq-chat__thread-value {
    font-size: 10px;
  }

  .srfq-chat__thread-title {
    font-size: 12px;
  }

  .srfq-chat__thread-preview {
    font-size: 10px;
  }

  .srfq-chat__lightbox {
    padding: 16px;
  }

  .srfq-chat__lightbox-close {
    top: 14px;
    left: 14px;
  }
}


/* 2.2.8.178 chat polish */
.srfq-chat__thread {
  gap: 0;
}

.srfq-chat__thread-body {
  width: 100%;
}

.srfq-chat__thread-top {
  align-items: baseline;
}

.srfq-chat__thread-value,
.srfq-chat__thread-time {
  color: #0f172a;
}

.srfq-chat__thread-previewline {
  align-items: baseline;
}

.srfq-chat__icon {
  width: 50px;
  height: 50px;
  color: #1d4ed8;
  box-shadow: 0 8px 18px rgba(37,99,235,.08);
}

.srfq-chat__icon-graphic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.srfq-chat__icon-graphic svg {
  width: 24px;
  height: 24px;
  display: block;
}

.srfq-chat__lightbox {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, .82);
  z-index: 999999;
  backdrop-filter: blur(4px);
}

.srfq-chat__lightbox.is-open {
  display: flex;
}

.srfq-chat__lightbox-stage {
  max-width: min(94vw, 1100px);
  max-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.srfq-chat__lightbox-img {
  max-width: 100%;
  max-height: 88vh;
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0,0,0,.35);
}

.srfq-chat__lightbox-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.srfq-chat__noscroll,
.srfq-chat__noscroll body {
  overflow: hidden;
}

@media (max-width: 720px) {
  .srfq-chat__icon {
    width: 48px;
    height: 48px;
  }

  .srfq-chat__icon-graphic,
  .srfq-chat__icon-graphic svg {
    width: 22px;
    height: 22px;
  }

  .srfq-chat__lightbox {
    padding: 14px;
  }

  .srfq-chat__lightbox-close {
    top: 12px;
    right: 12px;
  }
}


/* 2.2.9.179 chat polish */
.srfq-chat__thread-top {
  justify-content: flex-start;
}

.srfq-chat__thread-previewline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.srfq-chat__thread-preview {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.srfq-chat__thread-metaend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  color: #0f172a;
}

.srfq-chat__thread-time {
  color: #0f172a !important;
  font-weight: 700;
}

.srfq-chat__thread-avatar {
  display: none !important;
}

.srfq-chat__icon {
  width: 56px;
  min-width: 56px;
  height: 46px;
  border-radius: 14px;
  border: 1px solid #bfdbfe;
  background: linear-gradient(180deg, #eff6ff 0, #ffffff 100%);
  color: #2563eb;
}

.srfq-chat__icon-graphic,
.srfq-chat__icon-graphic svg {
  width: 24px;
  height: 24px;
}

@media (max-width: 720px) {
  .srfq-chat__icon {
    width: 52px;
    min-width: 52px;
    height: 44px;
  }
}


/* 2.2.11.181 composer alignment pass */
.srfq-chat__composer {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 96px;
  align-items: stretch;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--chat-border);
  background: #fff;
}

.srfq-chat__composer > * {
  margin: 0 !important;
}

.srfq-chat__icon,
.srfq-chat__composer-field,
.srfq-chat__send {
  min-height: 48px;
  height: 48px;
}

.srfq-chat__icon {
  width: 56px;
  min-width: 56px;
  padding: 0;
  border-radius: 14px;
  align-self: stretch;
}

.srfq-chat__icon-graphic,
.srfq-chat__icon-graphic svg {
  width: 24px;
  height: 24px;
}

.srfq-chat__composer-field {
  display: flex;
  align-items: stretch;
  min-width: 0;
}

.srfq-chat__input {
  min-height: 48px;
  height: 48px;
  max-height: 132px;
  padding: 12px 14px;
  line-height: 1.65;
  overflow-y: auto;
  box-sizing: border-box;
}

.srfq-chat__send {
  min-width: 96px;
  width: 96px;
  padding: 0 16px;
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 900px) {
  .srfq-chat__composer {
    grid-template-columns: 52px minmax(0, 1fr) 84px;
    gap: 8px;
    padding: 10px 12px;
  }

  .srfq-chat__icon,
  .srfq-chat__composer-field,
  .srfq-chat__send,
  .srfq-chat__input {
    min-height: 46px;
    height: 46px;
  }

  .srfq-chat__icon {
    width: 52px;
    min-width: 52px;
  }

  .srfq-chat__send {
    width: 84px;
    min-width: 84px;
    padding-inline: 12px;
  }
}

@media (max-width: 560px) {
  .srfq-chat__composer {
    grid-template-columns: 48px minmax(0, 1fr) 76px;
    gap: 8px;
    padding: 10px 10px max(10px, env(safe-area-inset-bottom));
  }

  .srfq-chat__icon,
  .srfq-chat__composer-field,
  .srfq-chat__send,
  .srfq-chat__input {
    min-height: 44px;
    height: 44px;
  }

  .srfq-chat__icon {
    width: 48px;
    min-width: 48px;
    border-radius: 12px;
  }

  .srfq-chat__icon-graphic,
  .srfq-chat__icon-graphic svg {
    width: 22px;
    height: 22px;
  }

  .srfq-chat__send {
    width: 76px;
    min-width: 76px;
    border-radius: 12px;
    font-size: 13px;
  }

  .srfq-chat__input {
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 13px;
  }
}


/* 2.2.26.265 mobile/fullscreen chat layout */
.srfq-chat__sidebar {
  overflow: hidden;
}

.srfq-chat__threads-list {
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.srfq-chat__header {
  flex-wrap: nowrap;
}

.srfq-chat__headtext {
  display: grid;
  gap: 4px;
}

.srfq-chat__title,
.srfq-chat__subtitle {
  white-space: normal;
}

.srfq-chat__actionsbar {
  padding: 12px 16px;
  border-bottom: 1px solid var(--chat-border);
  background: #fff;
}

.srfq-chat__actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  justify-content: flex-start;
  width: 100%;
}

.srfq-chat__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  white-space: nowrap;
}

.srfq-chat__banner-wrap {
  border-bottom: 1px solid var(--chat-border);
  background: #fff7d6;
}

.srfq-chat__banner-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  background: transparent;
  color: #7a5a00;
  padding: 11px 16px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.srfq-chat__banner-toggle::after {
  content: '▾';
  font-size: 14px;
  line-height: 1;
}

.srfq-chat__banner-wrap.is-collapsed .srfq-chat__banner-toggle::after {
  content: '▸';
}

.srfq-chat__banner {
  padding-top: 0;
  border-bottom: 0;
}

.srfq-chat__banner-wrap.is-collapsed .srfq-chat__banner {
  display: none;
}

.srfq-chat__summary-toolbar {
  padding-top: 10px;
  background: #f8fafc;
}

.srfq-chat__summary-toolbar-title {
  line-height: 1.8;
}

.srfq-chat__main {
  position: relative;
}

.srfq-chat__composer {
  position: sticky;
  bottom: 0;
  z-index: 7;
  box-shadow: 0 -12px 24px rgba(15, 23, 42, .06);
}

html.srfq-chat__viewport-lock,
html.srfq-chat__viewport-lock body,
body.srfq-chat__viewport-lock {
  overflow: hidden !important;
}

@media (min-width: 901px) {
  .srfq-chat__threads-list {
    padding-bottom: 14px;
  }
}

@media (max-width: 900px) {
  .srfq-chat__actions {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .srfq-chat--mobile-open {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    bottom: var(--srfq-chat-bottom-offset, 0px);
    z-index: 999998;
    width: 100vw;
    height: calc(var(--srfq-chat-viewport-height, 100dvh) - var(--srfq-chat-bottom-offset, 0px));
    max-width: 100vw;
    border-radius: 0;
    border: 0;
    background: #fff;
    box-shadow: none;
  }

  .srfq-chat--mobile-open .srfq-chat__layout {
    height: calc(var(--srfq-chat-viewport-height, 100dvh) - var(--srfq-chat-bottom-offset, 0px));
    min-height: calc(var(--srfq-chat-viewport-height, 100dvh) - var(--srfq-chat-bottom-offset, 0px));
    max-height: calc(var(--srfq-chat-viewport-height, 100dvh) - var(--srfq-chat-bottom-offset, 0px));
  }

  .srfq-chat__header {
    align-items: flex-start;
    padding: 12px 14px;
  }

  .srfq-chat__headtext {
    gap: 3px;
  }

  .srfq-chat__title {
    font-size: 15px;
    line-height: 1.8;
  }

  .srfq-chat__subtitle {
    font-size: 11px;
    line-height: 1.9;
  }

  .srfq-chat__actionsbar {
    padding: 10px 12px;
  }

  .srfq-chat__actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .srfq-chat__action {
    width: 100%;
    min-width: 0;
    padding: 10px 8px;
    font-size: 12px;
    border-radius: 12px;
  }

  .srfq-chat__banner-toggle {
    padding: 10px 12px;
  }

  .srfq-chat__summary-toolbar {
    position: static;
    padding: 10px 12px 3px;
  }

  .srfq-chat__summary {
    padding: 8px 12px 10px;
  }

  .srfq-chat__messages {
    padding: 14px 12px;
  }

  .srfq-chat__composer-meta {
    padding: 8px 12px 0;
    font-size: 11px;
  }

  .srfq-chat__composer {
    padding: 10px 12px max(10px, env(safe-area-inset-bottom));
  }

  .srfq-chat--mobile-open .srfq-chat__composer {
    bottom: 0;
  }
}


/* 2.2.42.303 chat RTL alignment + mobile dock fix */
.srfq-chat__thread-fields,
.srfq-chat__summary-grid {
  direction: rtl;
}

.srfq-chat__thread-value--status,
.srfq-chat__kv-value {
  unicode-bidi: plaintext;
}

@media (max-width: 720px) {
  .srfq-chat__kv,
  .srfq-chat__thread-field {
    align-items: flex-start;
  }

  .srfq-chat__kv-value,
  .srfq-chat__thread-value {
    text-align: right;
  }
}


/* 2.2.42.304 chat receipt + viewport stabilization */
.srfq-chat__thread-field,
.srfq-chat__kv {
  direction: rtl;
}

.srfq-chat__thread-label,
.srfq-chat__kv-label {
  flex: 0 0 auto;
}

.srfq-chat__thread-value,
.srfq-chat__kv-value {
  text-align: right;
  direction: rtl;
  unicode-bidi: isolate;
}

@media (max-width: 720px) {
  .srfq-chat--mobile-open {
    min-height: calc(var(--srfq-chat-viewport-height, 100dvh) - var(--srfq-chat-bottom-offset, 0px));
    max-height: calc(var(--srfq-chat-viewport-height, 100dvh) - var(--srfq-chat-bottom-offset, 0px));
  }

  .srfq-chat--mobile-open .srfq-chat__main,
  .srfq-chat--mobile-open .srfq-chat__messages-wrap {
    min-height: 0;
  }
}


/* chat 2.2.42.307 mobile viewport polish */
@media (max-width: 720px) {
  .srfq-chat--mobile-open {
    overflow: hidden;
  }

  .srfq-chat--mobile-open .srfq-chat__layout,
  .srfq-chat--mobile-open .srfq-chat__main,
  .srfq-chat--mobile-open .srfq-chat__messages-wrap {
    min-height: 0;
    overflow: hidden;
  }
}


/* chat 2.2.42.310 external bottom drawer stacking fix */
@media (max-width: 720px) {
  .srfq-chat--mobile-open.srfq-chat--external-drawer-open {
    z-index: 999 !important;
  }

  #smbb-cat-drawer,
  #smbb-account-drawer,
  [id^="smbb-"][id$="-drawer"],
  [id*="smbb"][id*="drawer"],
  .smbb-drawer,
  .smbb [class*="drawer"],
  .smbb [class*="panel"],
  .smbb [class*="sheet"],
  .smbb [class*="popover"],
  .smbb [class*="overlay"] {
    z-index: 1000000 !important;
  }
}


.srfq-chat__header-badges{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-top:8px;
}

.srfq-chat__thread-layers{
  display:flex;
  flex-direction:column;
  gap:8px;
  margin-top:8px;
}

.srfq-chat__thread-layer{
  display:flex;
  align-items:flex-start;
  flex-wrap:wrap;
  gap:8px;
  padding:8px 10px;
  border:1px dashed #dbe2ea;
  border-radius:12px;
  background:#f8fafc;
}

.srfq-chat__thread-layer-title{
  flex:0 0 auto;
  font-size:11px;
  font-weight:800;
  color:#64748b;
  line-height:1.8;
  white-space:nowrap;
}

.srfq-chat__thread-layer-items{
  display:flex;
  flex:1 1 auto;
  align-items:center;
  flex-wrap:wrap;
  gap:6px;
  min-width:0;
}

.srfq-chat__thread-layer--lifecycle{
  background:linear-gradient(180deg, rgba(239,246,255,.85) 0, rgba(248,250,252,.98) 100%);
  border-color:#dbeafe;
}

.srfq-chat__thread-layer--attention{
  background:linear-gradient(180deg, rgba(255,251,235,.92) 0, rgba(248,250,252,.98) 100%);
  border-color:#fde68a;
}

.srfq-chat__thread-layer--lock{
  background:linear-gradient(180deg, rgba(248,250,252,.94) 0, rgba(255,255,255,.98) 100%);
  border-color:#cbd5e1;
}

/* === Chat UI state system refresh === */
.srfq-chat__pill.is-active,
.srfq-chat__thread-status--active,
.srfq-chat__thread-status--info,
.srfq-chat__summary-card--state-active{
  background:#dbeafe;
  color:#1d4ed8;
  border-color:#bfdbfe;
}

.srfq-chat__pill.is-waiting,
.srfq-chat__thread-status--waiting,
.srfq-chat__summary-card--state-waiting{
  background:#fef3c7;
  color:#92400e;
  border-color:#fcd34d;
}

.srfq-chat__pill.is-completed,
.srfq-chat__thread-status--completed,
.srfq-chat__summary-card--state-completed{
  background:#dcfce7;
  color:#166534;
  border-color:#bbf7d0;
}

.srfq-chat__pill.is-inactive,
.srfq-chat__thread-status--inactive,
.srfq-chat__summary-card--state-inactive{
  background:rgba(156,163,175,.12);
  color:#475569;
  border-color:rgba(148,163,184,.4);
}

.srfq-chat__pill.is-rejected,
.srfq-chat__thread-status--rejected,
.srfq-chat__summary-card--state-rejected{
  background:#fee2e2;
  color:#b91c1c;
  border-color:#fecaca;
}

.srfq-chat__pill.is-archived,
.srfq-chat__thread-status--archived,
.srfq-chat__summary-card--state-archived{
  background:#f1f5f9;
  color:#475569;
  border-color:#cbd5e1;
}

.srfq-chat__pill.is-blocked,
.srfq-chat__thread-status--blocked{
  background:#ffedd5;
  color:#c2410c;
  border-color:#fdba74;
}

.srfq-chat__thread-status--guide,
.srfq-chat__pill.is-guide{
  background:#e0f2fe;
  color:#0369a1;
  border-color:#bae6fd;
}

.srfq-chat__thread-status--default,
.srfq-chat__pill.is-default,
.srfq-chat__summary-card--state-default{
  background:#f8fafc;
  color:#334155;
  border-color:#cbd5e1;
}

.srfq-chat__summary-card--state-active{
  background:linear-gradient(180deg, rgba(37,99,235,.06) 0, rgba(255,255,255,.98) 100%);
}
.srfq-chat__summary-card--state-waiting{
  background:linear-gradient(180deg, rgba(245,158,11,.08) 0, rgba(255,255,255,.98) 100%);
}
.srfq-chat__summary-card--state-completed{
  background:linear-gradient(180deg, rgba(16,185,129,.06) 0, rgba(255,255,255,.98) 100%);
}
.srfq-chat__summary-card--state-inactive{
  background:linear-gradient(180deg, rgba(148,163,184,.12) 0, rgba(255,255,255,.98) 100%);
}
.srfq-chat__summary-card--state-rejected{
  background:linear-gradient(180deg, rgba(239,68,68,.06) 0, rgba(255,255,255,.98) 100%);
}
.srfq-chat__summary-card--state-archived,
.srfq-chat__summary-card--state-default{
  background:linear-gradient(180deg, rgba(226,232,240,.55) 0, rgba(255,255,255,.98) 100%);
}

.srfq-chat__lock.is-inactive,
.srfq-chat__thread-closed-note.is-inactive{
  background:rgba(148,163,184,.12);
  border-color:rgba(148,163,184,.24);
  color:#475569;
}

.srfq-chat__lock.is-rejected,
.srfq-chat__thread-closed-note.is-rejected{
  background:#fee2e2;
  border-color:#fecaca;
  color:#991b1b;
}

.srfq-chat__lock.is-blocked,
.srfq-chat__thread-closed-note.is-blocked{
  background:#ffedd5;
  border-color:#fdba74;
  color:#9a3412;
}

.srfq-chat__lock.is-guide,
.srfq-chat__thread-closed-note.is-guide{
  background:#e0f2fe;
  border-color:#bae6fd;
  color:#075985;
}

.srfq-chat__lock.is-archived,
.srfq-chat__thread-closed-note.is-archived{
  background:#f1f5f9;
  border-color:#cbd5e1;
  color:#475569;
}

.srfq-chat--admin .srfq-chat__msg.role-customer.is-other .srfq-chat__bubble{
  background:#dbeafe;
  border-color:#bfdbfe;
}

.srfq-chat--admin .srfq-chat__msg.role-supplier.is-other .srfq-chat__bubble{
  background:#dcfce7;
  border-color:#bbf7d0;
}

.srfq-chat--admin .srfq-chat__msg.role-admin .srfq-chat__bubble,
.srfq-chat--admin .srfq-chat__msg.role-admin.is-other .srfq-chat__bubble{
  background:#f3f4f6;
  border-color:#e5e7eb;
}

.srfq-chat--admin .srfq-chat__msg.role-customer .srfq-chat__sender{
  background:#eff6ff;
  border-color:#bfdbfe;
  color:#1d4ed8;
}

.srfq-chat--admin .srfq-chat__msg.role-supplier .srfq-chat__sender{
  background:#ecfdf5;
  border-color:#bbf7d0;
  color:#166534;
}

.srfq-chat--admin .srfq-chat__msg.role-admin .srfq-chat__sender{
  background:#f8fafc;
  border-color:#cbd5e1;
  color:#334155;
}

/* 2.2.45.355 chat message tools: reply/edit/delete/copy */
.srfq-chat__msg.is-highlight .srfq-chat__bubble {
  box-shadow: 0 0 0 3px rgba(37,99,235,.18), 0 8px 24px rgba(15,23,42,.06);
}

.srfq-chat__replyref {
  display: block;
  width: 100%;
  border: 0;
  border-right: 3px solid rgba(37,99,235,.45);
  background: rgba(255,255,255,.62);
  border-radius: 12px;
  padding: 7px 9px;
  margin: 0 0 8px;
  color: #334155;
  text-align: right;
  cursor: pointer;
}

.srfq-chat__replyref-label {
  display: block;
  font-size: 10px;
  font-weight: 800;
  color: #1d4ed8;
  line-height: 1.5;
}

.srfq-chat__replyref-text {
  display: block;
  font-size: 11px;
  line-height: 1.7;
  color: #475569;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.srfq-chat__deleted {
  color: #64748b;
  font-size: 13px;
  font-style: italic;
  line-height: 1.9;
}

.srfq-chat__msg.is-deleted .srfq-chat__bubble {
  background: #f8fafc;
  border-style: dashed;
  color: #64748b;
}

.srfq-chat__edited {
  color: #64748b;
}

/* 2.2.48.358 compact transparent chat message actions */
.srfq-chat__bubble {
  position: relative;
  overflow: visible;
  padding-inline-start: 44px;
}

.srfq-chat__msg:focus-within {
  z-index: 8;
}

.srfq-chat__msg-menu {
  position: absolute;
  inset-inline-start: 8px;
  bottom: 8px;
  z-index: 6;
  direction: rtl;
}

.srfq-chat__msg-menu.is-open {
  z-index: 30;
}

.srfq-chat__msg-menu-toggle {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: #475569;
  border-radius: 999px;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  box-shadow: none;
  opacity: .34;
  transition: opacity .15s ease, color .15s ease, transform .15s ease;
}

.srfq-chat__bubble:hover .srfq-chat__msg-menu-toggle,
.srfq-chat__msg:focus-within .srfq-chat__msg-menu-toggle,
.srfq-chat__msg-menu.is-open .srfq-chat__msg-menu-toggle {
  opacity: 1;
}

.srfq-chat__msg-menu-toggle:hover,
.srfq-chat__msg-menu.is-open .srfq-chat__msg-menu-toggle {
  background: transparent;
  color: #1d4ed8;
  transform: translateY(-1px);
}

.srfq-chat__msg-actions {
  position: absolute;
  inset-inline-start: 0;
  bottom: calc(100% + 7px);
  min-width: 112px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 6px;
  margin: 0;
  background: rgba(255,255,255,.98);
  border: 1px solid rgba(203,213,225,.9);
  border-radius: 14px;
  box-shadow: 0 14px 34px rgba(15,23,42,.16);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px) scale(.98);
  transform-origin: bottom right;
  transition: opacity .14s ease, transform .14s ease, visibility .14s ease;
}

.srfq-chat__msg-menu.is-open .srfq-chat__msg-actions {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.srfq-chat__msg-action {
  width: 100%;
  border: 0;
  background: transparent;
  color: #334155;
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.4;
  text-align: right;
  cursor: pointer;
  white-space: nowrap;
}

.srfq-chat__msg-action:hover,
.srfq-chat__msg-action:focus {
  background: #eff6ff;
  color: #1d4ed8;
  outline: none;
}

.srfq-chat__msg-action.is-danger {
  color: #b91c1c;
}

.srfq-chat__msg-action.is-danger:hover,
.srfq-chat__msg-action.is-danger:focus {
  background: #fee2e2;
  color: #dc2626;
}

.srfq-chat__replybar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid #bfdbfe;
  border-right: 4px solid #2563eb;
  background: #eff6ff;
  color: #1e3a8a;
  border-radius: 14px;
  padding: 8px 10px;
  margin-bottom: 6px;
}

.srfq-chat__replybar strong,
.srfq-chat__replybar span {
  display: block;
  line-height: 1.6;
}

.srfq-chat__replybar strong {
  font-size: 11px;
}

.srfq-chat__replybar span {
  font-size: 12px;
  color: #334155;
}

.srfq-chat__replybar button {
  border: 0;
  background: #dbeafe;
  color: #1d4ed8;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 900;
}

.srfq-chat__composer-hint {
  font-size: 11px;
  color: #64748b;
}

@media (hover: none) {
  .srfq-chat__msg-menu-toggle { opacity: 1; }
}

/* 2.2.48.358: deleted messages have no action menu, so keep their original compact padding. */
.srfq-chat__msg.is-deleted .srfq-chat__bubble {
  padding-inline-start: 14px;
}

/* 2.2.49.362 chat action modals + RTL own-message alignment */
.srfq-chat__messages {
  direction: ltr;
}

.srfq-chat__day,
.srfq-chat__empty {
  direction: rtl;
}

.srfq-chat__msg {
  direction: ltr;
}

.srfq-chat__msg.is-me {
  justify-content: flex-end;
}

.srfq-chat__msg.is-other {
  justify-content: flex-start;
}

.srfq-chat__msg.is-me .srfq-chat__bubble {
  margin-left: 0;
  margin-right: 0;
  direction: rtl;
  text-align: right;
  padding-left: 14px;
  padding-right: 44px;
}

.srfq-chat__msg.is-other .srfq-chat__bubble {
  margin-left: 0;
  margin-right: 0;
  direction: rtl;
  text-align: right;
}

.srfq-chat__msg.is-me .srfq-chat__text,
.srfq-chat__msg.is-me .srfq-chat__sender,
.srfq-chat__msg.is-me .srfq-chat__deleted,
.srfq-chat__msg.is-me .srfq-chat__replyref {
  text-align: right;
  direction: rtl;
}

.srfq-chat__msg.is-me .srfq-chat__meta {
  direction: rtl;
  justify-content: flex-start;
  text-align: right;
}

.srfq-chat__msg.is-me .srfq-chat__tick {
  direction: ltr;
  unicode-bidi: plaintext;
}

.srfq-chat__msg.is-me .srfq-chat__msg-menu {
  left: auto;
  right: 8px;
  inset-inline-start: auto;
  inset-inline-end: 8px;
}

.srfq-chat__msg.is-me .srfq-chat__msg-actions {
  left: auto;
  right: 0;
  inset-inline-start: auto;
  inset-inline-end: 0;
  transform-origin: bottom right;
}

.srfq-chat__input {
  direction: rtl;
  text-align: right;
}

.srfq-chat__notice.is-success {
  background: #dcfce7;
  color: #166534;
}

.srfq-chat__notice.is-danger {
  background: #fee2e2;
  color: #991b1b;
}

.srfq-chat__notice.is-warning {
  background: #fff7ed;
  color: #9a3412;
}

.srfq-chat-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  direction: rtl;
}

.srfq-chat-modal.is-open {
  display: flex;
}

.srfq-chat-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .52);
  backdrop-filter: blur(4px);
}

.srfq-chat-modal__dialog {
  position: relative;
  width: min(100%, 440px);
  background: #fff;
  border: 1px solid rgba(226, 232, 240, .95);
  border-radius: 22px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, .26);
  padding: 22px;
  text-align: right;
  color: #0f172a;
  animation: srfq-chat-modal-in .16s ease-out;
}

@keyframes srfq-chat-modal-in {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.srfq-chat-modal__x {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.srfq-chat-modal__x:hover,
.srfq-chat-modal__x:focus {
  background: #e2e8f0;
  outline: none;
}

.srfq-chat-modal__icon {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: #eff6ff;
  margin-bottom: 12px;
  position: relative;
}

.srfq-chat-modal__icon:before {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 999px;
  border: 3px solid #2563eb;
}

.srfq-chat-modal.is-warning .srfq-chat-modal__icon {
  background: #fff7ed;
}

.srfq-chat-modal.is-warning .srfq-chat-modal__icon:before {
  border-color: #ea580c;
}

.srfq-chat-modal.is-danger .srfq-chat-modal__icon {
  background: #fee2e2;
}

.srfq-chat-modal.is-danger .srfq-chat-modal__icon:before {
  border-color: #dc2626;
}

.srfq-chat-modal.is-report .srfq-chat-modal__icon {
  background: #ffedd5;
}

.srfq-chat-modal.is-report .srfq-chat-modal__icon:before {
  border-color: #f97316;
}

.srfq-chat-modal__title {
  font-size: 17px;
  font-weight: 900;
  margin: 0 0 8px;
}

.srfq-chat-modal__message {
  font-size: 13px;
  line-height: 1.9;
  color: #475569;
  margin-bottom: 16px;
  white-space: pre-wrap;
}

.srfq-chat-modal__field {
  display: block;
  margin-bottom: 14px;
}

.srfq-chat-modal__field[hidden] {
  display: none !important;
}

.srfq-chat-modal__label {
  display: block;
  font-size: 12px;
  font-weight: 800;
  color: #334155;
  margin-bottom: 7px;
}

.srfq-chat-modal__textarea {
  width: 100%;
  min-height: 116px;
  resize: vertical;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  padding: 11px 12px;
  font-size: 13px;
  line-height: 1.8;
  outline: none;
  direction: rtl;
  text-align: right;
}

.srfq-chat-modal__textarea:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}

.srfq-chat-modal__error {
  margin: -4px 0 12px;
  padding: 8px 10px;
  border-radius: 12px;
  background: #fee2e2;
  color: #991b1b;
  font-size: 12px;
}

.srfq-chat-modal__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 10px;
}

.srfq-chat-modal__btn {
  border: 0;
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.srfq-chat-modal__btn--cancel {
  background: #f1f5f9;
  color: #334155;
}

.srfq-chat-modal__btn--confirm {
  background: #2563eb;
  color: #fff;
}

.srfq-chat-modal.is-warning .srfq-chat-modal__btn--confirm,
.srfq-chat-modal.is-report .srfq-chat-modal__btn--confirm {
  background: #ea580c;
}

.srfq-chat-modal.is-danger .srfq-chat-modal__btn--confirm {
  background: #dc2626;
}

.srfq-chat-modal__btn:hover,
.srfq-chat-modal__btn:focus {
  filter: brightness(.96);
  outline: none;
}

@media (max-width: 520px) {
  .srfq-chat-modal {
    align-items: flex-end;
    padding: 12px;
  }
  .srfq-chat-modal__dialog {
    border-radius: 20px;
    padding: 20px 16px;
  }
  .srfq-chat-modal__btn {
    flex: 1 1 auto;
  }
}

/* 2.2.49.366: source-of-truth positioning for per-message action menus.
   The toggle stays inside each bubble and the popup opens inward by default,
   while JS can flip the side when viewport space is tighter on mobile. */
.srfq-chat__msg .srfq-chat__msg-menu {
  left: auto;
  right: 8px;
  inset-inline-start: auto;
  inset-inline-end: 8px;
}

.srfq-chat__msg .srfq-chat__msg-actions {
  top: auto;
  bottom: 0;
  left: auto;
  right: auto;
  inset-inline-start: auto;
  inset-inline-end: auto;
  max-inline-size: min(220px, calc(100vw - 32px));
}

.srfq-chat__msg .srfq-chat__msg-menu[data-menu-side="left"] .srfq-chat__msg-actions {
  left: 0;
  right: auto;
  inset-inline-start: 0;
  inset-inline-end: auto;
  transform-origin: bottom left;
}

.srfq-chat__msg .srfq-chat__msg-menu[data-menu-side="right"] .srfq-chat__msg-actions {
  right: 0;
  left: auto;
  inset-inline-end: 0;
  inset-inline-start: auto;
  transform-origin: bottom right;
}

.srfq-chat__msg.is-deleted .srfq-chat__bubble {
  padding-inline-start: 14px;
  padding-inline-end: 14px;
}

@media (max-width: 520px) {
  .srfq-chat__msg .srfq-chat__msg-actions {
    min-width: 104px;
    max-inline-size: calc(100vw - 24px);
  }
}


/* 2.2.49.364 empty chat mobile scroll fix */
.srfq-chat__threads-list.is-empty,
.srfq-chat__messages.is-empty{
  min-height: 160px;
  overscroll-behavior: auto;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}
.srfq-chat__messages.is-empty{
  cursor: default;
}
@media (max-width: 720px){
  .srfq-chat.srfq-chat--empty-threads:not(.srfq-chat--mobile-open){
    overflow: visible;
  }
  .srfq-chat.srfq-chat--empty-threads:not(.srfq-chat--mobile-open) .srfq-chat__layout{
    height: auto;
    min-height: 0;
    max-height: none;
    overflow: visible;
  }
  .srfq-chat.srfq-chat--empty-threads:not(.srfq-chat--mobile-open) .srfq-chat__sidebar,
  .srfq-chat.srfq-chat--empty-threads:not(.srfq-chat--mobile-open) .srfq-chat__threads-list{
    min-height: 0;
    overflow: visible;
  }
}


/* v2.2.125.444 - external mobile bottom bar/drawer must stay interactive above the mobile chat panel. */
@media (max-width:720px){
  body.srfq-external-drawer-open .srfq-chat--mobile-open,
  html.srfq-external-drawer-open .srfq-chat--mobile-open,
  .srfq-chat--mobile-open.srfq-chat--external-drawer-open{
    z-index:10 !important;
    pointer-events:none !important;
  }
  body.srfq-external-drawer-open .srfq-chat--mobile-open .srfq-chat-modal,
  html.srfq-external-drawer-open .srfq-chat--mobile-open .srfq-chat-modal{
    pointer-events:none !important;
  }
  #smbb-bar.smbb-bar,
  .smbb-bar{
    z-index:1000002 !important;
    pointer-events:auto !important;
  }
  #smbb-cat-drawer,
  #smbb-account-drawer,
  [id^="smbb-"][id$="-drawer"],
  [id*="smbb"][id*="drawer"],
  .smbb-drawer,
  .smbb-drawer *,
  [id^="smbb-"][id$="-drawer"] *,
  [id*="smbb"][id*="drawer"] *{
    pointer-events:auto !important;
  }
  #smbb-cat-drawer,
  #smbb-account-drawer,
  [id^="smbb-"][id$="-drawer"],
  [id*="smbb"][id*="drawer"],
  .smbb-drawer,
  .smbb [class*="drawer"],
  .smbb [class*="panel"],
  .smbb [class*="sheet"],
  .smbb [class*="popover"],
  .smbb [class*="overlay"]{
    z-index:1000003 !important;
  }
}

/* v2.2.126.445 - SMBB stacking fix: keep overlay below drawer/bar and keep chat non-interactive while drawer is open. */
@media (max-width:720px){
  body.srfq-external-drawer-open .srfq-chat--mobile-open,
  html.srfq-external-drawer-open .srfq-chat--mobile-open,
  .srfq-chat--mobile-open.srfq-chat--external-drawer-open{
    z-index:999998 !important;
    pointer-events:none !important;
  }
  body.srfq-external-drawer-open #smbb-root,
  html.srfq-external-drawer-open #smbb-root,
  #smbb-root{
    pointer-events:auto !important;
  }
  #smbb-root .smbb-overlay{
    z-index:2147482997 !important;
    pointer-events:auto !important;
  }
  #smbb-root #smbb-cat-drawer.smbb-drawer,
  #smbb-root #smbb-account-drawer.smbb-drawer,
  #smbb-root [id^="smbb-"][id$="-drawer"].smbb-drawer,
  #smbb-root .smbb-drawer{
    z-index:2147482998 !important;
    pointer-events:auto !important;
  }
  #smbb-root #smbb-cat-drawer.smbb-drawer *,
  #smbb-root #smbb-account-drawer.smbb-drawer *,
  #smbb-root .smbb-drawer *{
    pointer-events:auto !important;
  }
  #smbb-root #smbb-bar.smbb-bar,
  #smbb-root .smbb-bar{
    z-index:2147482999 !important;
    pointer-events:auto !important;
  }
}
