.support-shell { padding: 2px; }
.support-head { display: grid; min-height: 80px; padding: 0 0 14px 56px; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 18px; border-bottom: 1px solid var(--line); }
.support-back { position: absolute; z-index: 3; top: 11px; left: 13px; }
.support-head > div { min-width: 0; }
.support-head h2 { max-width: 720px; margin: 8px 0 5px; overflow: hidden; font-size: 21px; text-overflow: ellipsis; white-space: nowrap; }
.support-head p { margin: 0; color: #7b8998; font-size: 9px; line-height: 1.5; }
.support-viewer { padding: 0; border: 0; border-radius: 0; color: #18856d; background: transparent; font-size: 8px; font-weight: 700; white-space: nowrap; }
.chat-product-summary { display: grid; min-height: 64px; padding: 8px; margin-top: 2px; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 5px; background: #fff; }
.chat-product-image { display: grid; width: 52px; height: 48px; overflow: hidden; place-items: center; border-radius: 4px; color: #fff; background: var(--blue); font-size: 16px; font-weight: 800; }
.chat-product-image img { width: 100%; height: 100%; object-fit: cover; }
.chat-product-copy { min-width: 0; }
.chat-product-copy b,.chat-product-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-product-copy b { font-size: 11px; }
.chat-product-copy small { margin-top: 5px; color: #8a97a5; font-size: 8px; }
.chat-product-summary>strong { color: var(--coral); font-size: 14px; white-space: nowrap; }
.chat-context-row { display: flex; min-width: 0; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; }
.chat-context-row>.request-intervention { margin: 0; }
.chat-context-row>.intervention-form,.chat-context-row>.intervention-status { width: 100%; flex: 1 1 100%; margin-top: 0; }
.chat-participants { display: grid; padding: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; border: 1px solid var(--line); border-radius: 5px; background: #f8fafc; }
.chat-participants>span,.chat-participant-member { display: grid; min-width: 0; grid-template-columns: 28px 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; }
.chat-participant-member { padding: 0; border: 0; color: inherit; background: none; text-align: left; cursor: pointer; }
.chat-participant-member:hover .chat-participant-avatar,.chat-participant-member:focus-visible .chat-participant-avatar { box-shadow: 0 0 0 3px var(--theme-accent-soft, #f7f1e3); }
.chat-participants i,.chat-participant-avatar { display: grid; width: 28px; height: 28px; overflow:hidden; grid-row: 1 / 3; place-items: center; border-radius: 50%; color: #fff; background: #60748d; font-size: 9px; font-style: normal; font-weight: 800; }
.chat-participants .platform i,.chat-participants .platform .chat-participant-avatar { color:var(--theme-accent-contrast,#17130b); background:var(--theme-accent,#b88a2a); }
.chat-participant-avatar img,.gts-agent-avatar img { width:100%; height:100%; object-fit:cover; }
.chat-participants b { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.chat-participants b em,.gts-agent-identity em { color:var(--theme-accent,#b88a2a); font-style:normal; font-weight:800; }
.chat-participants small { overflow: hidden; color: #8a97a5; font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }
.request-intervention { display: block; padding: 7px 0; margin: 9px 0 0 auto; border: 0; color: #9b5d31; background: none; font-size: 8px; font-weight: 700; }
.intervention-form { display: grid; padding: 12px; margin-top: 9px; gap: 8px; border: 1px solid #e7c9ad; border-radius: 5px; background: #fff8f1; }
.intervention-form label { color: #85522d; font-size: 9px; font-weight: 700; }
.intervention-form textarea { min-height: 74px; padding: 9px; border: 1px solid #dfc3aa; border-radius: 4px; outline-color: #a96b3b; font: inherit; font-size: 9px; resize: vertical; }
.intervention-form>div { display: flex; justify-content: flex-end; gap: 7px; }
.intervention-form button,.resolution-tools button { padding: 8px 11px; border: 1px solid #d9e2ea; border-radius: 4px; color: #677686; background: #fff; font-size: 8px; }
.intervention-form .confirm,.resolution-tools .confirm { border-color: var(--blue); color: #fff; background: var(--blue); }
.intervention-status { display: grid; padding: 10px 12px; margin-top: 9px; grid-template-columns: auto 1fr auto; align-items: center; gap: 9px; border: 1px solid #c9d9ee; border-radius: 4px; color: #546e91; background: #f1f6fc; font-size: 8px; }
.intervention-status b { color: var(--blue); font-size: 9px; }
.chat-log { display: flex; height: 280px; padding: 16px 10px; margin-top: 10px; flex-direction: column; gap: 9px; overflow-y: auto; border: 1px solid var(--line); border-radius: 5px; background: #f6f8fb; }
.chat-product-card { width: min(100%, 620px); padding: 12px; border: 1px solid #d8c17d; border-left: 4px solid var(--theme-accent, #b88a2a); border-radius: 6px; color: #324255; background: #fffaf0; box-shadow: 0 3px 12px rgba(43, 35, 17, .06); }
.chat-product-card[data-chat-order-card] { cursor: pointer; transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.chat-product-card[data-chat-order-card]:hover,.chat-product-card[data-chat-order-card]:focus-visible { border-color: var(--theme-accent, #b88a2a); box-shadow: 0 6px 18px rgba(43, 35, 17, .12); outline: none; transform: translateY(-1px); }
.chat-product-card header { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.chat-product-card-image { display: grid; width: 54px; height: 54px; overflow: hidden; place-items: center; border-radius: 5px; color: #fff; background: var(--theme-accent, #b88a2a); font-size: 18px; font-weight: 800; }
.chat-product-card-image img { width: 100%; height: 100%; object-fit: cover; }
.chat-product-card header span:nth-child(2) { min-width: 0; }
.chat-product-card header b,.chat-product-card header small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-product-card header b { font-size: 12px; }
.chat-product-card header small { margin-top: 4px; color: #8b7850; font-size: 9px; }
.chat-product-card header strong { color: #9b7020; font-size: 13px; white-space: nowrap; }
.chat-product-card dl { display: grid; margin: 10px 0 5px; gap: 5px; }
.chat-product-card dl > div { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 8px; }
.chat-product-card dt { color: #8a97a5; font-size: 9px; }
.chat-product-card dd { min-width: 0; margin: 0; overflow-wrap: anywhere; color: #4a5866; font-size: 10px; font-weight: 700; }
.chat-product-card-kind { display: inline-block; padding: 3px 6px; border-radius: 3px; color: #8f6721; background: #f5e7bc; font-size: 8px; font-weight: 800; }
.chat-message { width: fit-content; min-width: 0; max-width: min(76%, 590px); }
.chat-message>div { display: flex; margin: 0 4px 4px; align-items: center; gap: 7px; }
.chat-message b { color: #536475; font-size: 8px; }
.gts-agent-identity { display:inline-flex; min-width:0; align-items:center; gap:6px; }
.gts-agent-identity>b { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.gts-agent-avatar { display:grid; width:25px; height:25px; overflow:hidden; flex:none; place-items:center; border-radius:50%; color:var(--theme-accent-contrast,#17130b); background:var(--theme-accent,#b88a2a); font-size:9px; font-weight:800; }
.gts-agent-avatar img,
.chat-member-avatar img { width: 100%; height: 100%; object-fit: cover; }
.gts-agent-identity.compact .gts-agent-avatar { width:21px; height:21px; font-size:8px; }
.chat-member-identity { display: inline-flex; min-width: 0; align-items: center; gap: 6px; }
.chat-member-identity.is-shop-link { padding: 0; border: 0; color: inherit; background: none; font: inherit; cursor: pointer; }
.chat-member-identity.is-shop-link:hover .chat-member-avatar,.chat-member-identity.is-shop-link:focus-visible .chat-member-avatar { box-shadow: 0 0 0 3px var(--theme-accent-soft, #f7f1e3); }
.chat-member-avatar { display: grid; width: 25px; height: 25px; overflow: hidden; flex: none; place-items: center; border: 1px solid #dcc177; border-radius: 50%; color: var(--theme-accent-contrast, #17130b); background: var(--theme-accent, #b88a2a); font-size: 9px; font-weight: 800; }
.chat-member-identity > b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-presence { display: inline-flex; align-items: center; gap: 4px; color: #7d8995; font-size: 9px; font-weight: 700; line-height: 1.2; white-space: nowrap; }
.chat-presence i { width: 6px; height: 6px; flex: none; border-radius: 50%; background: #9aa6b1; box-shadow: 0 0 0 2px rgba(154, 166, 177, .14); }
.presale-presence { display: inline-flex; align-items: center; gap: 4px; color: #7d8995; font-size: 9px; font-weight: 700; line-height: 1.2; white-space: nowrap; }
.presale-presence i { width: 6px; height: 6px; flex: none; border-radius: 50%; background: #9aa6b1; box-shadow: 0 0 0 2px rgba(154, 166, 177, .14); }
.chat-presence.is-online { color: #18856d; }
.chat-presence.is-online i { background: #22b894; box-shadow: 0 0 0 2px rgba(34, 184, 148, .15); }
.chat-presence.is-busy,
.presale-presence.is-busy { color: #a8751f; }
.chat-presence.is-busy i,
.presale-presence.is-busy i { background: #d5a43a; box-shadow: 0 0 0 2px rgba(213, 164, 58, .16); }
.chat-name-row { display: flex; min-width: 0; margin: 8px 0 5px; align-items: center; gap: 8px; }
.chat-name-row h2 { min-width: 0; flex: 1 1 auto; margin: 0; }
.chat-name-row h2 span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-presence.header { flex: none; margin: 0; padding: 0; border: 0; color: #18856d; background: transparent; font-size: 10px; }
.chat-presence,
.chat-presence.header,
.support-viewer { border: 0 !important; background: transparent !important; box-shadow: none !important; }

/* Presence is a lightweight status marker, never a dark badge. */
.support-shell .chat-presence,
.support-shell .chat-presence.header,
.support-shell .support-viewer {
  padding: 0 !important;
  border: 0 !important;
  color: inherit;
  background: transparent !important;
  box-shadow: none !important;
}
.chat-participants .chat-presence.participant { grid-column: 2; min-width: 0; margin-top: 1px; font-size: 7px; }
.chat-participants .chat-presence.participant i { width: 5px; height: 5px; }
.chat-message time { color: #9ba6b1; font-size: 7px; }
.chat-message p { padding: 9px 11px; margin: 0; border: 1px solid #dfe6ed; border-radius: 5px; color: #4f5e6e; background: #fff; font-size: 9px; line-height: 1.65; }
.merchant-read-status { display: block; margin: 5px 4px 0; color: var(--theme-accent, #a87d1d); font-size: 11px; font-weight: 800; line-height: 1.3; }
.chat-message.is-own .merchant-read-status { text-align: right; }
.chat-message.buyer { align-self: flex-end; }
.chat-message.buyer>div { justify-content: flex-end; }
.chat-message.buyer p { border-color: #bdd0f4; color: #244e92; background: #edf3ff; }
.chat-message.platform { width: 100%; max-width: 100%; }
.chat-message.platform p { border-color: #c5e3da; color: #2f6f62; background: #eff9f6; }
.chat-message.system p { border-color: #d9bd72; color: #927022; background: #fff9e8; }
.chat-message.system { width: 100%; max-width: 100%; text-align: center; }
.chat-message.system>div { justify-content: center; }
.chat-composer { display: grid; visibility: visible; position: relative; z-index: 2; min-height: 62px; margin-top: 9px; flex: none; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 8px; }
#supportMessageForm.chat-composer { display: grid; }
.chat-composer textarea { min-height: 62px; padding: 10px; border: 1px solid #d8e1e9; border-radius: 4px; outline-color: var(--blue); font: inherit; font-size: 9px; resize: vertical; }
.chat-composer button { min-width: 96px; border: 0; border-radius: 4px; color: #fff; background: var(--blue); font-size: 9px; font-weight: 700; }
.chat-media-picker { display: grid; width: 42px; min-height: 42px; place-items: center; align-self: stretch; overflow: hidden; border: 1px solid var(--theme-accent, #d1a741); border-radius: 4px; color: var(--theme-accent, #a87d1d); background: var(--theme-accent-soft, #fff8e6); cursor: pointer; }
.chat-media-picker .ui-icon { width: 19px; height: 19px; }
.chat-media-picker input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.chat-attachments { display: grid; margin-top: 6px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.chat-attachments .chat-attachment-image,
.chat-attachments video { display: block; width: 100%; overflow: hidden; border: 1px solid #dfe4e8; border-radius: 5px; background: #101216; }
.chat-attachments .chat-attachment-image { padding: 0; cursor: zoom-in; }
.chat-attachments img { display: block; width: 100%; max-height: 260px; object-fit: contain; }
.chat-attachments video { max-height: 280px; }
.media-preview-list { display: flex; min-width: 0; grid-column: 1 / -1; flex-wrap: wrap; gap: 6px; }
.media-preview-item { display: grid; position: relative; width: 104px; min-height: 50px; padding: 4px 24px 4px 4px; grid-template-columns: 42px minmax(0, 1fr); align-items: center; gap: 5px; overflow: hidden; border: 1px solid #ded4b8; border-radius: 4px; background: #fffaf0; }
.media-preview-item img,
.media-preview-item > b { display: grid; width: 42px; height: 42px; place-items: center; object-fit: cover; border-radius: 3px; color: #fff; background: #24201a; font-size: 12px; }
.media-preview-item small { overflow: hidden; color: #6d6252; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.media-preview-item button { position: absolute; top: 3px; right: 3px; width: 20px; min-width: 20px; height: 20px; min-height: 20px; padding: 0; border: 0; border-radius: 50%; color: #fff; background: #7e6c4f; font-size: 13px; line-height: 20px; }
.qikswap-media-preview { position: fixed; z-index: 1000; inset: 0; display: grid; padding: max(24px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left)); place-items: center; background: rgb(10 12 15 / 88%); cursor: zoom-out; }
.qikswap-media-preview img { display: block; max-width: min(1100px, 100%); max-height: min(82vh, 900px); border: 1px solid rgb(206 166 75 / 72%); border-radius: 6px; box-shadow: 0 20px 60px rgb(0 0 0 / 42%); object-fit: contain; background: #101216; cursor: default; }
.qikswap-media-preview-close { position: fixed; top: max(14px, env(safe-area-inset-top)); right: max(14px, env(safe-area-inset-right)); display: grid; width: 40px; height: 40px; padding: 0; place-items: center; border: 1px solid #c99a38; border-radius: 5px; color: #f7df9f; background: #151412; box-shadow: 0 4px 16px rgb(0 0 0 / 28%); cursor: pointer; }
.resolution-tools { display: grid; padding: 13px; margin-top: 12px; grid-template-columns: 1fr 1fr; gap: 9px; border: 1px solid #c6d7ef; border-radius: 5px; background: #f2f6fc; }
.resolution-tools>div:first-child { display: flex; flex-direction: column; gap: 4px; }
.resolution-tools b { font-size: 9px; }
.resolution-tools small { color: #7f8ea0; font-size: 8px; }
.resolution-tools textarea { min-height: 62px; padding: 8px; border: 1px solid #d2deeb; border-radius: 4px; font: inherit; font-size: 8px; resize: vertical; }
.resolution-tools>div:nth-of-type(2) { display: flex; grid-column: 1 / -1; justify-content: flex-end; gap: 7px; }
.resolution-tools p { grid-column: 1 / -1; margin: 0; color: #8c6c50; font-size: 7px; }
.platform-summary { display: grid; margin-bottom: 18px; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.platform-summary span { padding: 12px; border: 1px solid var(--line); border-radius: 4px; color: #7c8997; font-size: 8px; }
.platform-summary b { display: block; margin-bottom: 5px; color: var(--ink); font-size: 18px; }
.case-list { display: flex; flex-direction: column; gap: 8px; }
.case-list article { display: grid; padding: 12px; grid-template-columns: 1fr auto; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 5px; }
.case-list h3 { margin: 6px 0 4px; font-size: 10px; }
.case-list p { margin: 0 0 5px; color: #6f7e8d; font-size: 8px; }
.case-list small { color: #94a0ac; font-size: 7px; }
.case-list button { padding: 8px 10px; border: 1px solid #cbd8e6; border-radius: 4px; color: var(--blue); background: #fff; font-size: 8px; }
.case-status { padding: 3px 5px; border-radius: 3px; color: #9a5b2e; background: #fff2e7; font-size: 7px; }
.order-dispute { display: flex; padding: 7px 9px; margin-top: 8px; align-items: center; justify-content: space-between; border-radius: 3px; color: #95603a; background: #fff4ea; font-size: 8px; }
.order-buttons.three button { min-width: 0; }
.refund-result { display: flex; padding: 9px; margin-top: 8px; align-items: center; justify-content: space-between; border-radius: 4px; color: #1f7866; background: #ecf9f5; font-size: 8px; }
.refund-result span { color: #6d8e87; }
.status-refunded { color: var(--teal); }
.seller-order-table>div { grid-template-columns: 1fr 2fr 65px 105px 60px; }
.seller-order-table>div>button { padding: 6px 8px; border: 1px solid #d3dfeb; border-radius: 4px; color: var(--blue); background: #fff; font-size: 8px; }
.message-inbox { padding: 2px; }
.message-inbox-head { min-height: 74px; }
.message-inbox-title-row { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 10px; }
.message-inbox-head h2 { margin: 8px 0 5px; font-size: 23px; }
.message-inbox-head p { margin: 0; color: #7b8998; font-size: 10px; }
.message-presence-group { display: flex; min-width: 0; margin-left: auto; align-items: center; gap: 7px; }
.message-presence-label { color: #927022; font-size: 10px; font-weight: 800; line-height: 1; white-space: nowrap; }
.message-presence-toggle { display: inline-flex; min-width: 64px; min-height: 28px; padding: 0 9px; flex: none; align-items: center; justify-content: center; gap: 6px; border: 1px solid #d9c78f; border-radius: 5px; color: #5d6771; background: #fffaf0; font: inherit; font-size: 11px; font-weight: 650; line-height: 1; white-space: nowrap; cursor: pointer; transition: border-color .16s ease, background .16s ease, opacity .16s ease; }
.message-presence-toggle i { width: 8px; height: 8px; flex: none; border-radius: 50%; box-shadow: 0 0 0 2px rgba(255,255,255,.9); }
.message-presence-toggle.is-online { border-color: #a8d8c3; background: #f2fbf7; }
.message-presence-toggle.is-online i { background: #22b573; }
.message-presence-toggle.is-busy { border-color: #dfc47c; background: #fff9e8; }
.message-presence-toggle.is-busy i { background: #d5a43a; }
.message-presence-toggle:hover { border-color: var(--theme-accent, #d1a741); }
.message-presence-toggle:focus-visible { outline: 2px solid var(--theme-accent, #d1a741); outline-offset: 2px; }
.message-presence-toggle:disabled { opacity: .65; cursor: wait; }
.message-search { display: flex; height: 38px; padding: 0 11px; margin: 3px 0 14px; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 4px; color: #8b98a5; background: #f8fafc; }
.message-search .ui-icon { width: 16px; height: 16px; flex: none; }
.message-search input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 11px; }
.message-inbox-link { min-height: 38px; padding: 0 13px; border: 1px solid var(--blue); border-radius: 4px; color: var(--blue); background: var(--theme-accent-soft, #edf3ff); font-size: 10px; font-weight: 700; }
.message-thread-list { display: flex; flex-direction: column; gap: 8px; }
.message-swipe-row { position: relative; overflow: hidden; min-height: 74px; border: 1px solid var(--line); border-radius: 5px; background: var(--theme-surface, #fff); }
.message-swipe-content { position: relative; z-index: 1; display: grid; min-height: 72px; grid-template-columns: minmax(0, 1fr) 48px; align-items: stretch; background: var(--theme-surface, #fff); transition: transform .2s ease; touch-action: pan-y; }
.message-swipe-row.is-dragging .message-swipe-content { transition: none; }
.message-swipe-row.is-open .message-swipe-content { transform: translateX(-240px); }
.message-thread { display: grid; width: 100%; min-height: 84px; padding: 10px 12px; grid-template-columns: 48px minmax(0, 1fr) 64px; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink); background: #fff; text-align: left; }
.message-thread:hover { border-color: var(--blue); background: var(--theme-accent-soft, #f5f8ff); }
.message-thread-avatar { display: grid; width: 48px; height: 48px; overflow: hidden; place-items: center; border: 1px solid #e2e8ee; border-radius: 50%; color: var(--theme-accent-contrast, #fff); background: var(--blue); font-size: 15px; font-weight: 800; }
.message-thread-avatar img { width: 100%; height: 100%; object-fit: cover; }
.message-thread-avatar.system { border-color: var(--theme-accent, #d1a741); color: var(--theme-accent-contrast, #17130b); background: var(--theme-accent, #d1a741); }
.message-thread-avatar.system .ui-icon { width: 22px; height: 22px; }
.message-thread-copy { min-width: 0; }
.message-thread-copy b, .message-thread-copy small, .message-thread-copy em { display: block; }
.message-thread-title { display: flex; min-width: 0; align-items: center; gap: 7px; }
.message-thread-title b { min-width: 0; }
.message-thread-title i { flex: none; color: #38a66d; font-size: 9px; font-style: normal; font-weight: 750; white-space: nowrap; }
.message-thread-copy b { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.message-thread-copy small { margin-top: 5px; overflow: hidden; color: #929da8; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.message-thread-copy em { padding: 0; margin-top: 5px; overflow: hidden; color: #5f6d7c; background: transparent; font-size: 11px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.message-thread-copy small i { color: #9aa6b2; font-style: normal; }
.message-thread-meta { display: grid; min-width: 64px; align-items: center; justify-items: end; gap: 4px; }
.message-thread time { color: #8a97a5; font-size: 9px; white-space: nowrap; }
.message-thread-product { display: grid; width: 54px; height: 42px; overflow: hidden; place-items: center; border: 1px solid #e2e7eb; border-radius: 5px; background: #f5f7f8; }
.message-thread-product:empty { visibility: hidden; }
.message-thread-product img { width: 100%; height: 100%; object-fit: cover; }
.message-thread-flags { display: flex; min-height: 13px; align-items: center; justify-content: flex-end; gap: 4px; }
.message-thread mark { padding: 3px 5px; border-radius: 3px; color: #fff; background: var(--coral, #f26f58); font-size: 8px; font-weight: 700; }
.message-pinned-label { color: var(--blue); font-size: 9px; font-weight: 700; white-space: nowrap; }
.message-thread.pinned { background: color-mix(in srgb, var(--theme-accent-soft, #f7f1e3) 55%, #fff); }
.message-thread.unread .message-thread-copy b { font-weight: 800; }
.message-desktop-delete { display: grid; width: 40px; height: 40px; padding: 0; place-self: center; place-items: center; border: 1px solid #ead5d5; border-radius: 5px; color: #b43b3b; background: #fff8f8; }
.message-desktop-delete .ui-icon { width: 18px; height: 18px; }
.message-desktop-delete:hover { color: #fff; background: #b93232; }
.message-swipe-actions { position: absolute; z-index: 0; top: 0; right: 0; display: none; width: 240px; height: 100%; grid-template-columns: repeat(3, 80px); }
.message-swipe-action { display: grid; min-width: 0; height: 100%; padding: 7px; place-items: center; border: 0; color: #fff; font-size: 12px; font-weight: 700; line-height: 1.25; }
.message-swipe-action.pin { color: var(--theme-accent-contrast, #17130b); background: var(--blue); }
.message-swipe-action.unread { background: #596878; }
.message-swipe-action.delete { background: #b93232; }
.message-empty { padding: 45px 20px; border: 1px dashed #d2dde7; color: #7f8c99; text-align: center; }
.message-empty b { display: block; color: var(--ink); font-size: 15px; }
.message-empty p { margin: 8px 0 16px; font-size: 10px; }
.system-notification-page { width: min(860px, 100%); margin: 0 auto; }
.system-notification-page > header { padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.system-notification-page > header h2 { margin: 7px 0 0; font-size: 24px; }
.system-notification-page > section { display: flex; padding-top: 14px; flex-direction: column; gap: 9px; }
.system-notification-item { display: grid; min-width: 0; padding: 14px; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--theme-surface, #fff); }
.system-notification-avatar { display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid var(--theme-accent, #d1a741); border-radius: 50%; color: var(--theme-accent-contrast, #17130b); background: var(--theme-accent, #d1a741); font-size: 14px; font-weight: 900; }
.system-notification-item > div { min-width: 0; }
.system-notification-item b { display: block; color: #9a7422; font-size: 13px; }
.system-notification-item p { margin: 5px 0; color: #667789; font-size: 11px; line-height: 1.5; }
.system-notification-item time { color: #8a97a5; font-size: 9px; }
.system-notification-item > button { max-width: 210px; min-height: 36px; padding: 7px 11px; overflow: hidden; border: 1px solid var(--theme-accent, #d1a741); border-radius: 4px; color: #715317; background: var(--theme-accent-soft, #fff8e6); font-size: 10px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.saved-item-main { display: flex; min-width: 0; padding: 0; flex: 1; align-items: center; gap: 9px; border: 0; color: inherit; background: transparent; text-align: left; }
.saved-item-main span { min-width: 0; flex: 1; }
.saved-item-main:hover b { color: var(--blue); }
.saved-item.unavailable { background: #fafafa; }
.saved-item.unavailable img { filter: grayscale(.75); opacity: .7; }
.saved-item.unavailable strong { color: #8b96a1; font-size: 9px; }
.saved-item-remove { flex: none; }

@media (max-width: 620px) {
  .support-head { min-height: 76px; padding: 0 8px 12px 56px; align-items: center; }
  .support-back { top: calc(12px + env(safe-area-inset-top)); left: 8px; }
  .support-head>div { min-width: 0; }
  .support-head .kicker { font-size: 9px; }
  .chat-name-row { margin: 4px 0 3px; gap: 6px; }
  .support-head h2 { margin: 0; font-size: 18px !important; line-height: 1.25; white-space: nowrap; }
  .support-head p { overflow: hidden; font-size: 11px !important; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
  .support-viewer { position: static; padding: 5px 7px; font-size: 10px !important; }
  .chat-product-summary { min-height: 60px; padding: 7px 12px; margin: 8px 12px 0; grid-template-columns: 48px minmax(0, 1fr) auto; border-radius: 6px; }
  .chat-product-image { width: 48px; height: 46px; }
  .chat-product-copy b { font-size: 13px; }
  .chat-product-copy small { font-size: 10px; }
  .chat-product-summary>strong { font-size: 15px; }
  .chat-context-row { min-height: 42px; padding: 4px 12px; flex: none; }
  .request-intervention { min-height: 32px; padding: 5px 2px; font-size: 11px !important; }
  .chat-participants { display: none; }
  .intervention-status { grid-template-columns: 1fr; }
  .chat-log { height: auto; min-height: 0; padding: 16px 12px 20px; margin: 0; flex: 1 1 auto; gap: 12px; border: 0; border-radius: 0; background: #f3f6f8; overscroll-behavior: contain; }
  .chat-product-card { width: 100%; box-sizing: border-box; padding: 11px; }
  .chat-product-card header { grid-template-columns: 48px minmax(0, 1fr) auto; }
  .chat-product-card-image { width: 48px; height: 48px; }
  .chat-product-card header b { font-size: 13px; }
  .chat-product-card header strong { font-size: 14px; }
  .chat-message { width: fit-content; min-width: 0; max-width: min(82%, 440px); }
  .chat-message>div { margin-bottom: 5px; }
  .chat-message b,.chat-message time { font-size: 10px !important; }
  .chat-message p { padding: 10px 12px; border-radius: 4px 14px 14px 14px; font-size: 14px !important; line-height: 1.5; }
  .chat-message.buyer p { border-radius: 14px 4px 14px 14px; }
  .chat-message.platform,.chat-message.system { width: 100%; max-width: 100%; }
  .chat-composer { padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); margin: 0; flex: none; grid-template-columns: 44px minmax(0, 1fr) 70px; gap: 8px; border-top: 1px solid var(--line); background: #fff; box-shadow: 0 -5px 18px rgba(20, 32, 48, .06); }
  .chat-media-picker { width: 44px; min-height: 46px; }
  .chat-composer textarea { min-height: 46px; max-height: 92px; padding: 11px 12px; border-radius: 6px; font-size: 16px !important; resize: none; }
  .message-detail-modal .chat-composer textarea { width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; transform: none; touch-action: manipulation; }
  .chat-composer button { min-width: 0; min-height: 46px; border-radius: 6px; font-size: 13px !important; }
  .media-preview-list { padding-bottom: 2px; flex-wrap: nowrap; overflow-x: auto; }
  .media-preview-item { flex: 0 0 104px; }
  .chat-attachments { grid-template-columns: 1fr; }
  .resolution-tools { grid-template-columns: 1fr; }
  .resolution-tools>div:nth-of-type(2),.resolution-tools p { grid-column: auto; }
  .platform-summary { grid-template-columns: 1fr 1fr 1fr; }
  .case-list article { grid-template-columns: 1fr; }
  .order-buttons.three { flex-wrap: wrap; }
  .order-buttons.three button { min-width: 46%; }
  .refund-result { align-items: flex-start; flex-direction: column; gap: 4px; }
  .seller-order-table>div { grid-template-columns: 80px 1fr 50px; }
  .seller-order-table>div>*:nth-child(4),.seller-order-table>div>*:nth-child(5) { grid-column: 2 / -1; }
  .message-inbox-head { display: block; }
  .message-thread { min-height: 80px; grid-template-columns: 44px minmax(0, 1fr) 58px; gap: 9px; }
  .message-thread-avatar { width: 44px; height: 44px; }
  .message-thread-meta { min-width: 58px; }
  .message-thread-product { width: 52px; height: 40px; }
  .system-notification-page > header h2 { font-size: 21px; }
  .system-notification-item { grid-template-columns: 38px minmax(0, 1fr); padding: 12px 10px; gap: 10px; }
  .system-notification-avatar { width: 38px; height: 38px; }
  .system-notification-item > button { max-width: none; grid-column: 2; justify-self: start; }
  .message-thread { border: 0; border-radius: 0; }
  .message-swipe-row { min-height: 70px; }
  .message-swipe-content { min-height: 68px; grid-template-columns: minmax(0, 1fr); }
  .message-swipe-row.is-open .message-swipe-content { transform: translateX(-240px); }
  .message-desktop-delete { display: none; }
  .message-swipe-actions { display: grid; }
}

@media (min-width: 621px) and (max-width: 900px) {
  .message-thread { min-height: 92px; }
  .message-thread-copy small,
  .message-thread-copy em { white-space: normal; }
}

.delivery-message-card { padding: 12px; border: 1px solid var(--theme-line, #d9c58c); border-radius: 5px; color: #324255; background: #fffaf0; box-shadow: inset 3px 0 0 var(--theme-accent, #b58b2e); }
.delivery-message-card > span { display: block; color: var(--theme-accent, #a87d1d); font-size: 9px; font-weight: 900; letter-spacing: .7px; }
.delivery-message-card dl { display: grid; margin: 10px 0; grid-template-columns: 1fr; gap: 6px; }
.delivery-message-card dl > div { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 8px; }
.delivery-message-card dt { color: #7c8794; font-size: 10px; }
.delivery-message-card dd { min-width: 0; margin: 0; color: #324255; font-size: 11px; font-weight: 700; overflow-wrap: anywhere; }
.delivery-message-accounts { padding-top: 9px; border-top: 1px dashed #d9c58c; }
.delivery-accounts-head { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 8px; }
.delivery-message-accounts b { display: block; margin-bottom: 7px; color: #4a596b; font-size: 10px; }
.delivery-accounts-head b { margin-bottom: 0; }
.chat-copy-all,.chat-copy-value { padding: 3px 6px; border: 1px solid var(--theme-accent, #d1a741); border-radius: 3px; color: #805f1c; background: var(--theme-accent-soft, #fff8e6); font: inherit; font-size: 9px; font-weight: 800; }
.chat-copy-value { padding: 1px 4px; border-color: transparent; color: inherit; background: transparent; text-align: left; text-decoration: underline; text-decoration-color: #d8c17d; text-underline-offset: 2px; }
.chat-copy-all:hover,.chat-copy-value:hover { color: #4f3810; border-color: var(--theme-accent, #d1a741); }
.chat-copy-menu { position: absolute; z-index: 4; display: flex; max-width: calc(100% - 8px); padding: 0; overflow: hidden; border: 1px solid var(--theme-accent, #d1a741); border-radius: 4px; background: #fffdf7; box-shadow: 0 5px 18px rgba(43, 35, 17, .18); user-select: none; }
.chat-copy-menu button { min-width: 0; padding: 7px 10px; border: 0; color: #725316; background: transparent; font-size: 10px; font-weight: 800; white-space: nowrap; touch-action: manipulation; }
.chat-copy-menu button + button { border-left: 1px solid #eadfbe; }
.chat-reply-reference { max-width: 100%; padding: 6px 8px; margin: 0 0 5px; overflow: hidden; border-left: 2px solid var(--theme-accent, #b88a2a); border-radius: 3px; color: #7e6a42; background: #fff8e8; font-size: 9px; line-height: 1.4; }
.chat-reply-reference span { margin-right: 4px; color: #9b7020; font-weight: 700; }
.chat-reply-reference b { color: #59471f; }
.chat-reply-reference p { padding: 0 !important; margin: 2px 0 0 !important; overflow: hidden; color: #7e6a42 !important; background: transparent !important; border: 0 !important; font-size: 9px !important; line-height: 1.4 !important; text-overflow: ellipsis; white-space: nowrap; }
.chat-reply-preview { display: flex; min-width: 0; grid-column: 1 / -1; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 9px; border-left: 3px solid var(--theme-accent, #b88a2a); border-radius: 3px; color: #725316; background: #fff8e8; font-size: 10px; }
.chat-reply-preview span { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-reply-preview b { margin-right: 4px; color: #9b7020; }
.chat-reply-preview small { display: block; overflow: hidden; color: #7e6a42; text-overflow: ellipsis; white-space: nowrap; }
.chat-reply-preview button { min-width: 24px; min-height: 24px; padding: 0; border: 0; color: #8b6b2d; background: transparent; font-size: 18px; line-height: 1; }
.chat-message-recalled,
.presale-message-recalled { color: #8995a1 !important; background: #f1f4f6 !important; border-color: #dce3e8 !important; font-style: italic; }
.delivery-message-accounts code { display: block; padding: 8px; margin-top: 5px; overflow-wrap: anywhere; border-radius: 3px; color: #1f2f40; background: #fff; font: 11px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.delivery-thanks { margin: 9px 0 0 !important; color: inherit; font-size: 12px !important; line-height: 1.6 !important; }
@media (max-width: 620px) {.chat-message.delivery-message{width:min(94%,500px);max-width:min(94%,500px)}.delivery-message-card{padding:11px}.delivery-message-card dd{font-size:12px}.delivery-message-accounts code{font-size:12px}}

/* Full-screen order chats must start below iOS browser chrome and the notch. */
@media (max-width: 620px) {
  .modal.message-detail-modal .support-shell {
    display: flex !important;
    box-sizing: border-box;
    padding-top: calc(10px + env(safe-area-inset-top));
    flex-direction: column;
    overflow: hidden;
  }
  .message-detail-modal .support-head {
    min-height: 76px;
    flex: 0 0 auto;
  }
}

.chat-message.resolution-message { width: min(92%, 540px); max-width: min(92%, 540px); }
.support-resolution-card { display: grid; padding: 13px; gap: 6px; border: 1px solid var(--theme-line, #dfca94); border-left: 4px solid var(--theme-accent, #b88a2a); border-radius: 5px; background: var(--theme-accent-soft, #fffaf0); }
.support-resolution-card > span { color: var(--theme-accent, #9b7622); font-size: 10px; font-weight: 800; }
.support-resolution-card > b { color: #202936; font-size: 15px; }
.support-resolution-card > p { margin: 0; color: #536477; font-size: 13px; line-height: 1.65; }
.support-resolution-card > small { color: #8a7446; font-size: 10px; }
.support-resolution-card > small .gts-agent-identity { margin-top:2px; }
.support-resolution-card.final { border-color: var(--theme-accent, #b88a2a); background: #fff7df; box-shadow: inset 0 0 0 1px rgba(184, 138, 42, .12); }

.support-head { grid-template-columns: 42px minmax(0, 1fr) auto; }
.chat-counterparty-avatar { display: grid; width: 42px; height: 42px; padding: 0; overflow: hidden; place-items: center; border: 1px solid var(--theme-accent, #d1a741); border-radius: 50%; color: inherit; background: #fff; }
button.chat-counterparty-avatar { cursor: pointer; }
button.chat-counterparty-avatar:hover { box-shadow: 0 0 0 3px var(--theme-accent-soft, #f7f1e3); }
.chat-head-avatar { display: grid; width: 100%; height: 100%; overflow: hidden; place-items: center; border-radius: 50%; color: var(--theme-accent-contrast, #17130b); background: var(--theme-accent, #d1a741); font-size: 13px; font-weight: 800; }
.chat-head-avatar img { width: 100%; height: 100%; object-fit: cover; }
.chat-order-countdown { display: block; margin-top: 10px; color: #a3761e; font-size: 10px; font-weight: 800; }
.chat-refund-status { display: inline-block; padding: 4px 7px; margin-top: 9px; border-radius: 3px; color: #8b6118; background: #f4e6b9; font-size: 9px; font-weight: 800; }
.chat-refund-status.status-approved { color: #207159; background: #e5f5ef; }
.chat-refund-status.status-rejected { color: #a2463a; background: #fff0ed; }
.chat-order-actions { display: flex; padding-top: 10px; margin-top: 10px; justify-content: flex-end; flex-wrap: wrap; gap: 7px; border-top: 1px solid #eadfbe; }
.chat-order-actions button { min-height: 34px; padding: 0 11px; border: 1px solid var(--theme-accent, #d1a741); border-radius: 4px; color: #795818; background: #fff; font-size: 10px; font-weight: 800; }
.chat-order-actions button.primary { color: var(--theme-accent-contrast, #17130b); background: var(--theme-accent, #d1a741); }
.chat-product-card .intervention-form { margin-top: 10px; }
.chat-message.is-own { align-self: flex-end; }
.chat-message.is-own > div { justify-content: flex-end; }
.chat-message.is-own p { border-color: #d9c37e; border-radius: 5px; color: #5f4919; background: #fff8e6; }
.chat-message.is-other { align-self: flex-start; }
.chat-message.is-other > div { justify-content: flex-start; }
.support-shell.viewer-seller .chat-message.buyer { align-self: flex-start; }
.support-shell.viewer-seller .chat-message.buyer > div { justify-content: flex-start; }
.support-shell.viewer-seller .chat-message.buyer p { border-color: #dfe6ed; color: #4f5e6e; background: #fff; }

.messages-route-page {
  min-height: calc(100vh - 110px);
  padding: 34px 24px 80px;
  overflow-x: clip;
  color: var(--ink);
  background: var(--theme-page, #f4f4f1);
}
.messages-route-page .message-inbox {
  width: min(1040px, 100%);
  padding: 0;
  margin: 0 auto;
}
.messages-route-page .message-thread-list { gap: 10px; }
.messages-route-page .message-swipe-row { border-radius: 7px; }
body.messages-route #top,
body.messages-route #productPage,
body.messages-route #storePage,
body.messages-route #accountPage,
body.messages-route #sellerPage,
body.messages-route #savedPage { display: none !important; }
body.messages-route > footer { display: none; }
@media (max-width: 620px) {
  .messages-route-page { min-height: calc(100vh - 62px); padding: 18px 15px 82px; }
  .messages-route-page .message-inbox-title-row { gap: 9px; }
  .messages-route-page .message-presence-group { gap: 6px; }
  .messages-route-page .message-presence-label { font-size: 11px; }
  .messages-route-page .message-inbox-head h2 { font-size: 25px; }
  .messages-route-page .message-presence-toggle { min-height: 30px; padding: 0 9px; }
}

@media (max-width: 620px) {
  .support-head { grid-template-columns: 38px minmax(0, 1fr) auto; padding-left: 56px; gap: 9px; }
  .chat-counterparty-avatar { width: 38px; height: 38px; }
  .chat-order-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chat-order-actions button { width: 100%; min-height: 38px; padding: 0 7px; white-space: normal; }
  .chat-message.is-own p { border-radius: 14px 4px 14px 14px; }
  .chat-message.is-other p { border-radius: 4px 14px 14px 14px; }
}

/* Keep message metadata independent from the bubble so short text stays compact. */
.chat-message > p {
  width: fit-content;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  padding: 9px 12px;
  overflow-wrap: anywhere;
  border: 0;
  font-size: 13px;
  line-height: 1.5;
  box-shadow: 0 1px 3px rgba(25, 40, 58, .1);
}
.chat-message.is-own > p {
  margin-right: 0;
  margin-left: auto;
  border-radius: 14px 4px 14px 14px;
  color: #fff;
  background: #1688f8;
}
.chat-message.is-other > p {
  margin-right: auto;
  margin-left: 0;
  border-radius: 4px 14px 14px 14px;
  color: #26384b;
  background: #fff;
}
.support-shell.viewer-seller .chat-message.buyer.is-other > p {
  color: #26384b;
  background: #fff;
}

/* Message surfaces: clearer hierarchy for inbox rows and the active chat. */
.messages-route-page .message-inbox-head { padding: 8px 2px 14px; }
.messages-route-page .message-inbox-head h2 { color: #17130b; letter-spacing: .01em; }
.messages-route-page .message-search { height: 44px; border-color: #d9c78f; background: #fff; box-shadow: 0 4px 14px rgba(25, 35, 48, .05); }
.messages-route-page .message-search:focus-within { border-color: var(--theme-accent, #d1a741); box-shadow: 0 0 0 3px var(--theme-accent-soft, #f7f1e3); }
.messages-route-page .message-thread { min-height: 94px; padding: 13px 15px; border-left: 3px solid transparent; border-radius: 8px; box-shadow: 0 4px 14px rgba(25, 35, 48, .045); transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.messages-route-page .message-thread:hover { border-left-color: var(--theme-accent, #d1a741); box-shadow: 0 8px 22px rgba(25, 35, 48, .09); transform: translateY(-1px); }
.messages-route-page .message-thread.unread { border-left-color: var(--theme-accent, #d1a741); background: linear-gradient(90deg, #fffaf0 0, #fff 28%); }
.messages-route-page .message-thread-avatar { width: 52px; height: 52px; border-color: #d9c78f; }
.messages-route-page .message-thread-copy b { font-size: 13px; }
.messages-route-page .message-thread-copy em { margin-top: 7px; font-size: 12px; }
.messages-route-page .message-thread-product { width: 58px; height: 46px; border-color: #d9c78f; }
.message-detail-modal .support-shell { max-height: min(760px, calc(100vh - 32px)); padding: 8px; overflow: hidden; }
.message-detail-modal .support-head { padding-bottom: 16px; border-bottom-color: #d9c78f; }
.message-detail-modal .chat-product-summary { border-color: #d9c78f; background: linear-gradient(90deg, #fffaf0, #fff); box-shadow: 0 4px 14px rgba(43, 35, 17, .06); }
.message-detail-modal .chat-participants { border-color: #e3d5aa; background: #fffaf0; }
.message-detail-modal .chat-log { height: 340px; padding: 18px 14px; border-color: #dbe2e8; background: #f3f6f8; }
.message-detail-modal .chat-composer { margin-top: 10px; border: 1px solid #d9c78f; border-radius: 7px; background: #fffaf0; box-shadow: 0 4px 14px rgba(43, 35, 17, .06); }

@media (max-width: 620px) {
  .messages-route-page .message-inbox-head { padding-bottom: 10px; }
  .messages-route-page .message-thread { min-height: 92px; padding: 11px 12px; border-left-width: 3px; box-shadow: 0 2px 9px rgba(25, 35, 48, .05); }
  .messages-route-page .message-thread-avatar { width: 46px; height: 46px; }
  .messages-route-page .message-thread-copy b { font-size: 13px; }
  .messages-route-page .message-thread-copy em { font-size: 12px; }
  .messages-route-page .message-thread-product { width: 52px; height: 42px; }
  .message-detail-modal .support-shell { max-height: 100%; padding: 0; }
  .message-detail-modal .chat-log { height: auto; min-height: 0; }
  .message-detail-modal .chat-composer { margin: 0; border-width: 1px 0 0; border-radius: 0; }
}
.chat-message.platform > p,
.chat-message.system > p { width: 100%; margin: 0; box-shadow: none; }

@media (max-width: 620px) {
  .chat-message > p { padding: 10px 13px; font-size: 15px !important; line-height: 1.45; }
}
