/* Shared glass treatment: a translucent surface and a fine reflected edge. */
:root {
  --market-glass:rgba(35,38,44,.74);
  --market-glass-edge:rgba(255,255,255,.17);
  --market-glass-light:rgba(255,255,255,.19);
  --market-glass-shadow:rgba(0,0,0,.16);
}
[data-theme=light] {
  --market-glass:rgba(250,251,253,.75);
  --market-glass-edge:rgba(121,132,149,.24);
  --market-glass-light:rgba(255,255,255,.95);
  --market-glass-shadow:rgba(32,42,58,.08);
}
.chat-page .compact-order-link,
.home-page [data-load-products],
.product-card .favorite {
  background:linear-gradient(145deg,rgba(255,255,255,.09),transparent 45%,rgba(255,255,255,.025)),var(--market-glass);
  border:1px solid var(--market-glass-edge);
  -webkit-backdrop-filter:blur(18px) saturate(150%);
  backdrop-filter:blur(18px) saturate(150%);
  box-shadow:inset 0 1px 0 var(--market-glass-light),inset 0 -1px 0 rgba(255,255,255,.04),0 5px 18px var(--market-glass-shadow);
}
.chat-page .compact-order-link:focus-visible,
.home-page [data-load-products]:focus-visible,
.product-card .favorite:focus-visible,
.room-header button:focus-visible {
  outline:2px solid var(--accent);
  outline-offset:3px;
}
.product-card .favorite {
  --market-glass:rgba(23,28,36,.46);
  --market-glass-edge:rgba(255,255,255,.32);
  --market-glass-light:rgba(255,255,255,.36);
  width:40px;height:40px;min-width:40px;min-height:40px;
  padding:0;top:9px;right:9px;border-radius:50%;color:#fff;
  transition:background-color .18s,border-color .18s;
}
.product-card .favorite .icon {width:19px;height:19px;filter:drop-shadow(0 1px 2px rgba(0,0,0,.3))}
.product-card .favorite.selected {color:#ff9eae;border-color:rgba(255,174,190,.65)}
.home-page [data-load-products] {min-height:48px;border-radius:24px;padding:12px 25px;color:var(--text)}
@media(hover:hover) {
  .chat-page .compact-order-link:hover,.home-page [data-load-products]:hover {border-color:color-mix(in srgb,var(--text) 35%,transparent)}
  .product-card .favorite:hover {background-color:rgba(255,255,255,.14);border-color:rgba(255,255,255,.65)}
}
@media(pointer:coarse) {.product-card .favorite {width:44px;height:44px}}

/* The order stays over the scrollable conversation, so messages pass behind the glass. */
.chat-page .messenger.room-open .chat-room:has(> .compact-order-link) {
  display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr) auto;
}
.chat-room:has(> .compact-order-link) > .room-header {grid-area:1 / 1}
.chat-page .compact-order-link {
  grid-area:2 / 1;align-self:start;position:relative;z-index:3;
  margin:12px 24px 0;width:calc(100% - 48px);height:76px;min-height:76px;
  padding:10px 14px;border-radius:18px;gap:12px;color:var(--text);
}
.chat-page .compact-order-link img {width:85.333px;height:48px;flex:none;border-radius:10px;object-fit:contain;background:var(--surface)}
.chat-page .compact-order-link > span {min-width:0}
.chat-page .compact-order-link strong {font-size:13px;line-height:1.4;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.chat-page .compact-order-link small {font-size:11px;line-height:1.4;margin-top:4px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.chat-page .compact-order-link b {font-size:15px;white-space:nowrap;flex:none}
.chat-page .compact-order-link em {font-size:11px;white-space:nowrap;flex:none;color:var(--text)}
.chat-page .chat-room:has(> .compact-order-link) > #message-scroll {grid-area:2 / 1;padding-top:104px;scroll-padding-top:104px}
.chat-room:has(> .compact-order-link) > .message-composer {grid-area:3 / 1}
.chat-page .room-header .audit-live {display:inline-flex;vertical-align:middle;padding:0;margin-left:7px;background:none;color:var(--accent);line-height:1}
.chat-page .room-header .audit-live .icon {width:16px;height:16px}
.room-header [data-manage-deal] {flex:none;min-height:44px;gap:8px}
.room-header [data-manage-deal] > .icon {width:18px;height:18px}

@media(max-width:760px) {
  .chat-page .room-header {flex-wrap:nowrap;min-height:68px;padding:8px 12px;gap:10px}
  .chat-page .room-header .mobile-back {width:44px;min-width:44px;height:44px;padding:0;flex:none;border:0;background:transparent;border-radius:14px}
  .chat-page .room-header .mobile-back span:not(.back-chevron) {display:none}
  .chat-page .mobile-back .back-chevron {font-size:34px;font-weight:400;transform:translateY(-2px)}
  .chat-page .room-header > div {flex:1 1 0;min-width:0}
  .chat-page .room-header .chat-person {gap:9px;width:100%;min-height:44px}
  .chat-page .room-header .chat-person .avatar {width:38px;height:38px;flex:0 0 38px}
  .chat-page .room-header .chat-person > span {flex:1;min-width:0}
  .chat-page .room-header strong {font-size:13px;line-height:1.4}
  .chat-page .room-header .chat-person strong {display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;white-space:normal;overflow-wrap:anywhere}
  .chat-page .room-header .presence {font-size:10px;margin-top:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .chat-page .room-header small {font-size:10px;line-height:1.4}
  .chat-page .room-header [data-manage-deal] {margin:0;width:44px;min-width:44px;height:44px;padding:0;justify-content:center;border-radius:14px;background:var(--raised)}
  .chat-page .room-header [data-manage-deal] > span {display:none}
  .chat-page .room-header [data-manage-deal] > .icon {width:20px;height:20px}
  .chat-page .compact-order-link {margin:8px 12px 0;width:calc(100% - 24px);height:76px;min-height:76px;padding:10px;gap:10px;border-radius:17px}
  .chat-page .compact-order-link img {width:64px;height:36px;border-radius:9px}
  .chat-page .compact-order-link strong {font-size:12px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;white-space:normal;overflow-wrap:anywhere;line-height:1.3}
  .chat-page .compact-order-link small {font-size:10px;margin-top:3px}
  .chat-page .compact-order-link b {font-size:13px}
  .chat-page .compact-order-link em {display:none}
  .chat-page .chat-room:has(> .compact-order-link) > #message-scroll {padding:100px 14px 16px;scroll-padding-top:100px}
  .chat-page .message-row {max-width:88%;margin-bottom:8px;align-items:flex-end}
  .chat-page .message-row > .message-avatar {display:none}
  .chat-page .message-row .message {padding:10px 13px;font-size:14px;line-height:1.5;border-radius:17px 17px 17px 5px}
  .chat-page .message-row.mine .message {border-radius:17px 17px 5px 17px}
  .chat-page .message-row .message footer {font-size:10px}
  .chat-page .message-composer {gap:8px;padding:8px 12px max(10px,env(safe-area-inset-bottom));border-top:1px solid var(--line)}
  .chat-page .composer-field {border-radius:20px;min-height:44px}
  .chat-page .message-composer .composer-field textarea {min-height:44px;font-size:16px;padding:10px 12px}
  .chat-page .message-composer > button {border-radius:50%}
  .chat-page .audit-conversation-banner {padding:9px 12px;gap:4px;flex-direction:column;line-height:1.5}
}
@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))) {
  .chat-page .compact-order-link,.home-page [data-load-products] {background:var(--raised)}
  .product-card .favorite {background:#242933}
}
@media(prefers-reduced-transparency:reduce) {
  .chat-page .compact-order-link,.home-page [data-load-products] {background:var(--raised);backdrop-filter:none;-webkit-backdrop-filter:none}
  .product-card .favorite {background:#242933;backdrop-filter:none;-webkit-backdrop-filter:none}
}
@media(prefers-reduced-motion:reduce) {.product-card .favorite {transition:none}}
