/* On-site buyer ↔ seller messages (0.3.64). Scoped so it does not fight theme CSS. */
.hx-smsg-flash { border-radius: 14px; padding: 12px 14px; font-weight: 700; margin: 0 0 14px; }
.hx-smsg-flash.ok { background: #E8F0E4; color: #3B4A32; }
.hx-smsg-flash.err { background: #F8E6E1; color: #8A3B28; }
.hx-smsg-lab { display: block; font-weight: 800; font-size: 14px; margin: 0 0 6px; }
.hx-smsg-form textarea,
.hx-smsg-form input[type="text"] {
  width: 100%;
  border: 1.5px solid var(--line, #E6DAC8);
  background: var(--paper, #FFFBF5);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  margin: 0 0 12px;
}
.hx-smsg-form textarea { min-height: 120px; resize: vertical; }
.hx-smsg-form textarea:focus,
.hx-smsg-form input[type="text"]:focus { outline: 2px solid var(--rust, #C05133); outline-offset: 1px; border-color: var(--rust, #C05133); }
.hx-smsg-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.hx-smsg-login { display: inline-flex !important; }
.hx-smsg-back { margin: 0 0 12px; }
.hx-smsg-head h2 { margin: 0 0 4px; font-size: 22px; }
.hx-smsg-meta { margin: 0 0 14px; color: var(--muted, #7A6E62); font-weight: 600; font-size: 14px; }
.hx-smsg-st { font-weight: 800; }
.hx-smsg-st.st-open { color: var(--sage, #5F734F); }
.hx-smsg-st.st-closed { color: var(--muted, #7A6E62); }
.hx-smsg-log { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.hx-smsg-bubble { max-width: 92%; border-radius: 16px; padding: 10px 12px; background: #fff; border: 1px solid var(--line, #E6DAC8); }
.hx-smsg-bubble.mine { align-self: flex-end; background: var(--rust-tint, #F6E5E0); border-color: transparent; }
.hx-smsg-bubble.role-admin { background: #F3EFE4; }
.hx-smsg-bubble .who { font-size: 12px; font-weight: 800; color: var(--muted, #7A6E62); margin: 0 0 4px; display: flex; justify-content: space-between; gap: 10px; }
.hx-smsg-bubble .bod { white-space: pre-wrap; font-weight: 600; }
.hx-smsg-list { list-style: none; margin: 0; padding: 0; }
.hx-smsg-list li { border-top: 1px solid var(--line, #E6DAC8); }
.hx-smsg-list li:first-child { border-top: 0; }
.hx-smsg-list a { display: flex; flex-direction: column; gap: 2px; padding: 14px 4px; text-decoration: none; color: inherit; }
.hx-smsg-list a:hover { color: var(--rust, #C05133); }
.hx-smsg-list .t { font-weight: 800; }
.hx-smsg-list .t em { font-style: normal; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; background: var(--rust, #C05133); color: #fff; border-radius: 999px; padding: 1px 7px; margin-left: 6px; }
.hx-smsg-list .m, .hx-smsg-list .w { color: var(--muted, #7A6E62); font-size: 13px; font-weight: 600; }
.hx-smsg-list .p { font-weight: 600; font-size: 14px; }
.hx-smsg-list li.is-unread a { background: var(--rust-tint, #F6E5E0); margin: 0 -8px; padding-left: 12px; padding-right: 12px; border-radius: 12px; }
.hx-smsg-side {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 1px 7px;
  margin-right: 4px;
  vertical-align: 1px;
  line-height: 1.4;
  white-space: nowrap;
}
.hx-smsg-side.is-store { background: #E8F0E4; color: #3B4A32; }
.hx-smsg-side.is-asked { background: var(--rust-tint, #F6E5E0); color: var(--rust, #9A4129); }
#hxv .hx-smsg-home-list .who .hx-smsg-side { margin-right: 6px; vertical-align: 1px; }

.hx-smsg-account-head h2 { margin: 0 0 6px; }
.hx-smsg-account-head p { margin: 0 0 16px; color: var(--muted, #7A6E62); font-weight: 600; }

#hxs .store-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
#hxs .store-msg {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 0;
  background: var(--rust, #C05133);
  color: #fff;
  font-weight: 800;
  font-size: 14.5px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
#hxs .store-msg:hover { background: var(--rust-dark, #9A4129); color: #fff; }
#hxs .store-msg svg { width: 18px; height: 18px; flex: 0 0 18px; }
#hxs .hx-smsg-store { margin: 22px 0 8px; background: var(--paper, #FFFBF5); border: 1px solid var(--line, #E6DAC8); border-radius: 22px; padding: 20px 18px 18px; box-shadow: 0 10px 30px rgba(42,36,32,.08); }
#hxs .hx-smsg-store h2 { font-size: 22px; margin: 0 0 8px; }

@media (max-width: 430px) {
  .hx-smsg-bubble { max-width: 100%; }
  #hxs .store-actions { width: 100%; }
  #hxs .store-msg, #hxs .store-share { flex: 1 1 100%; justify-content: center; }
}

/* Keep in-page jumps / screenshots from tucking headings under the sticky header. */
#hx-enquiry, .enquiry-wrap, #hx-seller-msg, #tab-messages, .hx-smsg-account, .hx-smsg-thread {
  scroll-margin-top: 96px;
}

/* wp-admin conversation (WooCommerce → HX seller messages). */
.post-type-hx_seller_msg #postdivrich,
.post-type-hx_seller_msg #postexcerpt,
.post-type-hx_seller_msg #commentstatusdiv,
.post-type-hx_seller_msg #commentsdiv,
.post-type-hx_seller_msg #slugdiv { display: none !important; }
.post-type-hx_seller_msg #hx_smsg_thread .inside { padding: 16px 18px 20px; }
.post-type-hx_seller_msg .hx-smsg-form textarea,
.post-type-hx_seller_msg .hx-smsg-form input[type="text"] {
  max-width: 100% !important;
  width: 100% !important;
  min-height: 120px;
  display: block;
  box-sizing: border-box;
}
.post-type-hx_seller_msg .hx-smsg-lab { margin-top: 8px; display: block; }
.post-type-hx_seller_msg .hx-smsg-form .btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 18px !important;
  border-radius: 999px !important;
  font-weight: 700 !important;
  font-size: 14px !important;
  text-decoration: none;
  border: 0 !important;
  cursor: pointer;
  line-height: 1;
}
.post-type-hx_seller_msg .hx-smsg-form .btn-primary { background: #C05133 !important; color: #fff !important; }
.post-type-hx_seller_msg .hx-smsg-form .btn-soft { background: #fff !important; color: #2A2420 !important; border: 1.5px solid #E6DAC8 !important; }
.post-type-hx_seller_msg .hx-smsg-log { list-style: none; }

/* Seller dashboard bottom nav: Messages adds a 6th–8th item. Keep one tappable row at 360–430px. */
#hxv.hx-smsg-has-tab .bnav {
  grid-template-columns: repeat(6, minmax(44px, 1fr));
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
#hxv.hx-smsg-has-tab .bnav::-webkit-scrollbar { display: none; }
#hxv.hx-smsg-has-tab .bnav .nb { font-size: 10px; letter-spacing: -.02em; }
#hxv.hx-smsg-has-tab .bnav .nb svg { width: 22px; height: 22px; }
#hxv.hx-smsg-has-tab .bnav .nb span:not(.dot) { white-space: nowrap; }

#hxv.hx-smsg-has-tab.hx-au-has-tab .bnav,
#hxv.hx-smsg-has-tab.hx-tq-has-quotes .bnav {
  grid-template-columns: repeat(7, minmax(44px, 1fr));
}
#hxv.hx-smsg-has-tab.hx-au-has-tab .bnav .nb,
#hxv.hx-smsg-has-tab.hx-tq-has-quotes .bnav .nb {
  font-size: 9px;
  letter-spacing: -.02em;
}
#hxv.hx-smsg-has-tab.hx-au-has-tab .bnav .nb svg,
#hxv.hx-smsg-has-tab.hx-tq-has-quotes .bnav .nb svg {
  width: 20px;
  height: 20px;
}

#hxv.hx-smsg-has-tab.hx-au-has-tab.hx-tq-has-quotes .bnav {
  grid-template-columns: repeat(8, minmax(44px, 1fr));
}
#hxv.hx-smsg-has-tab.hx-au-has-tab.hx-tq-has-quotes .bnav .nb {
  font-size: 8.5px;
  letter-spacing: -.03em;
}
#hxv.hx-smsg-has-tab.hx-au-has-tab.hx-tq-has-quotes .bnav .nb svg {
  width: 20px;
  height: 20px;
}

/* 0.3.61: sending state on every message form button */
@keyframes hx-smsg-spin {
  to { transform: rotate(360deg); }
}
.hx-smsg-form .btn.is-sending,
.hx-smsg-form button.is-sending {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  pointer-events: none;
  cursor: wait;
  opacity: .92;
}
.hx-smsg-spin {
  width: 16px;
  height: 16px;
  box-sizing: border-box;
  border: 2px solid rgba(255, 255, 255, .4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: hx-smsg-spin .7s linear infinite;
  flex: 0 0 16px;
}
.hx-smsg-form .btn-soft.is-sending .hx-smsg-spin,
.hx-smsg-form button.btn-soft.is-sending .hx-smsg-spin {
  border-color: rgba(192, 81, 51, .25);
  border-top-color: #C05133;
}
@media (max-width: 430px) {
  .hx-smsg-form .btn.is-sending { width: 100%; }
}


/* Dashboard home Messages card (0.3.64). */
#hxv .hx-smsg-home-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  margin-left: 8px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--rust, #C05133);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 20px;
  vertical-align: middle;
}
#hxv .hx-smsg-home-list {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
}
#hxv .hx-smsg-home-list li {
  border-top: 1px solid var(--line, #E6DAC8);
}
#hxv .hx-smsg-home-list li:first-child {
  border-top: 0;
}
#hxv .hx-smsg-home-list a {
  display: block;
  padding: 10px 2px;
  text-decoration: none;
  color: inherit;
  border-radius: 8px;
}
#hxv .hx-smsg-home-list a:hover {
  background: rgba(192, 81, 51, 0.06);
}
#hxv .hx-smsg-home-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
#hxv .hx-smsg-home-list .who {
  font-weight: 700;
  font-size: 15px;
  color: var(--ink, #2A2420);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
#hxv .hx-smsg-home-list li.is-unread .who {
  font-weight: 800;
}
#hxv .hx-smsg-home-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rust, #C05133);
  flex: 0 0 8px;
}
#hxv .hx-smsg-home-list .w {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted, #7A6E62);
  white-space: nowrap;
}
#hxv .hx-smsg-home-list .listing {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted, #7A6E62);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#hxv .hx-smsg-home .btn {
  width: 100%;
}
