.customer-help { position: fixed; z-index: 4; right: max(14px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 7px; }
.customer-help a, .customer-help button { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 13px; border: 1px solid #ffffff5c; border-radius: 24px; color: white; font: 700 .875rem/1.2 Inter,system-ui,sans-serif; box-shadow: 0 3px 12px #22131e38; cursor: pointer; text-decoration: none; }
.customer-help a { background: #116444; }
.customer-help button { background: #571e37; }
.customer-help [hidden] { display: none; }
.customer-help svg { width: 18px; height: 18px; flex: none; }
body:has(.customer-help) { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
.shop-chat { position: fixed; inset: auto max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) auto; margin: 0; padding: 0; width: min(400px,calc(100vw - 24px)); max-width: none; height: min(560px,calc(100dvh - 24px)); max-height: none; border: 1px solid #dacfd4; border-radius: 18px; background: #fff; color: #2c2027; font: 1rem/1.45 Inter,system-ui,sans-serif; box-shadow: 0 16px 65px #24121e44; overflow: hidden; }
.shop-chat[open] { display: flex; flex-direction: column; }
.shop-chat::backdrop { background: #25192140; }
.shop-chat-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 16px 18px; background: #501e34; color: white; }
.shop-chat-head h2 { margin: 0; color: inherit; font-size: 1.22rem; line-height: 1.15; }
.shop-chat-head p { margin: 4px 0 0; color: #f4e3eb; font-size: .86rem; }
.shop-chat-close { width: 44px; height: 44px; background: transparent; color: white; border: 1px solid #ffffff70; border-radius: 50%; font-size: 1.6rem; }
.shop-chat-body { padding: 16px; overflow-y: auto; flex: 1; min-height: 0; overscroll-behavior: contain; }
.shop-chat-intro { font-weight: 650; }
.shop-chat-prompts { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.shop-chat-prompts button { min-height: 36px; border-radius: 20px; border: 1px solid #dbcbd2; color: #522138; background: white; padding: 5px 10px; font: inherit; font-size: .85rem; }
.shop-chat-message { width: fit-content; max-width: 96%; margin: 10px 0; padding: 10px 12px; background: #f5f1f3; border-radius: 12px 12px 12px 3px; overflow-wrap: anywhere; }
.shop-chat-message.shopper { margin-left: auto; background: #512039; color: white; border-radius: 12px 12px 3px 12px; }
.shop-chat-message p { white-space: pre-line; margin: 0; font-size: .93rem; color: inherit; }
.shop-chat-message a { display: block; margin-top: 7px; color: #631d3d; font-size: .85rem; text-decoration: underline; }
.shop-chat-compose { padding: 10px 14px 0; border-top: 1px solid #e5dbe0; }
.shop-chat-compose label { display: block; font-size: .83rem; font-weight: 650; margin-bottom: 4px; }
.shop-chat-compose div { display: flex; gap: 6px; }
.shop-chat-compose input { flex: 1; min-width: 0; border: 1px solid #a99a9f; border-radius: 8px; padding: 10px; font: inherit; }
.shop-chat-compose button { padding: 8px 12px; background: #571e37; color: white; border: 0; border-radius: 8px; font: inherit; font-weight: 650; }
.shop-chat-handoff { align-self: flex-start; margin: 8px 14px 12px; color: #116444; text-decoration: underline; font-size: .85rem; }
@media (max-width: 480px) {
 .customer-help { gap: 6px; right: 8px; }
 .customer-help a, .customer-help button { padding-inline: 10px; }
}

html:has(.customer-help) { scroll-padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
.shop-chat { height: min(600px,calc(var(--chat-visible-height,100dvh) - 24px)); bottom: max(12px,env(safe-area-inset-bottom),var(--chat-keyboard,0px)); }
.shop-chat-head,.shop-chat-compose,.shop-chat-handoff { flex-shrink: 0; }
.shop-chat-compose button, .shop-chat-prompts button { min-height: 44px; }
.shop-chat-compose input { font-size: 1rem; }
@media (min-width:721px) and (max-width:1100px) {
 .shop-chat { width: min(440px,calc(100vw - 32px)); right: 16px; }
}
@media(max-width:720px) {
 .customer-help { right: 0; left: 0; bottom: 0; align-items: center; justify-content: center; min-height: 55px; padding: 5px max(12px,env(safe-area-inset-right)) max(5px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left)); border-top: 1px solid #e3d8de; background: #fff; }
 .customer-help a,.customer-help button { justify-content: center; flex: 1 1 0; max-width: 170px; box-shadow: none; }
 .shop-chat { left: 0; right: 0; bottom: var(--chat-keyboard,0px); width: 100%; height: min(660px,var(--chat-visible-height,100dvh)); border-radius: 18px 18px 0 0; padding-bottom: env(safe-area-inset-bottom); }
 .shop-chat-handoff { min-height: 32px; display: flex; align-items: center; margin: 3px 14px; }
}
@media (max-height:520px) {
 .shop-chat-head { padding: 6px 12px; }
 .shop-chat-head p { display: none; }
 .shop-chat-body { padding: 9px 12px; }
 .shop-chat-compose { padding-top: 3px; }
 .shop-chat-compose label { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
 .shop-chat-handoff { margin-block: 2px; }
}
