/* Order chat shares one viewport layout for buyers and administrators. */
.order-chat[hidden]{display:none!important}
.order-chat-launcher{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:16px 0;padding:18px;border:1px solid #2c4052;border-radius:18px;background:#101d2b;color:#edf3f8}
.order-chat-launcher>div{min-width:0;display:grid;gap:5px}.order-chat-launcher strong{font-size:17px}.order-chat-launcher span{font-size:13px;color:#afbecd}
.chat-open-button{flex-shrink:0;min-height:44px;padding:10px 16px;border:0;border-radius:12px;background:#b5ff30;color:#10180a;font-family:inherit;font-weight:700;font-size:14px;line-height:1.3;cursor:pointer}
dialog.chat-fullscreen{position:fixed!important;inset:auto;margin:0!important;padding:0!important;width:100vw;max-width:none!important;height:100dvh;max-height:none!important;border:0!important;border-radius:0!important;background:#0b1420;color:#eef4fa;overflow:hidden!important;overscroll-behavior:none;box-sizing:border-box}
dialog.chat-fullscreen::backdrop{background:#080e17}
dialog.chat-fullscreen .order-chat.chat-expanded{display:flex!important;flex-direction:column;gap:0;width:100%;height:100%;min-height:0;max-height:none;margin:0!important;padding:env(safe-area-inset-top,0px) env(safe-area-inset-right,0px) env(safe-area-inset-bottom,0px) env(safe-area-inset-left,0px)!important;border:0;border-radius:0;background:#0b1420;overflow:hidden!important;box-sizing:border-box}
.chat-fullscreen .chat-conversation-header{display:flex;align-items:center;gap:12px;flex-shrink:0;padding:12px 16px;border-bottom:1px solid #273747;background:#101d2b}
.chat-conversation-header>div{min-width:0}.chat-conversation-header strong{font-size:17px;line-height:1.3}
.chat-fullscreen .chat-conversation-header .order-chat-reference{display:block!important;margin:3px 0 0!important;font-size:11px;line-height:1.4;color:#a9bdcd;overflow-wrap:anywhere}
.chat-fullscreen .order-chat-reference strong{font-size:inherit;font-weight:500}
.chat-back-button{flex-shrink:0;width:44px;height:44px;min-height:44px;padding:0;border:1px solid #35495d;border-radius:50%;background:#182a3b;color:#f0f5fa;font-size:25px;cursor:pointer}
.chat-fullscreen .order-chat-head,.chat-fullscreen .order-chat-safety{display:none!important}
.chat-fullscreen .order-chat-tools{display:flex;flex-shrink:0;align-items:center;justify-content:space-between;gap:8px;margin:0;padding:6px 16px;background:#101d2b;border:0}
.chat-fullscreen .order-chat-tools small{display:none}.chat-fullscreen .order-chat-tools button{min-height:36px;width:auto;margin:0;padding:6px 10px;font-size:12px}
.chat-fullscreen .order-unread-badge{padding:5px 10px;font-size:11px}
.chat-fullscreen .order-chat-messages{flex:1 1 0!important;width:100%;min-height:40px!important;max-height:none!important;margin:0!important;padding:16px!important;border:0!important;border-radius:0!important;overflow:auto!important;overscroll-behavior:contain;scroll-behavior:auto;box-sizing:border-box;background:#0b1420}
.chat-fullscreen .order-chat-bubble{max-width:min(86%,680px);padding:12px 14px;border-radius:16px}.chat-fullscreen .order-chat-bubble p{font-size:16px;line-height:1.5;margin:5px 0 0;overflow-wrap:anywhere}.chat-fullscreen .order-chat-bubble small{font-size:11px}
.chat-fullscreen .order-chat-form{position:relative;display:grid!important;grid-template-columns:44px minmax(0,1fr) 64px;align-items:end;gap:6px 8px;flex:0 0 auto;margin:0!important;padding:10px 12px!important;border-top:1px solid #2c3c4d;background:#101d2b;box-sizing:border-box}
.chat-fullscreen .order-chat-form>label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.chat-fullscreen .order-chat-form textarea{grid-column:2;grid-row:2;width:100%;height:44px;min-height:44px!important;max-height:104px!important;margin:0;padding:11px 12px;resize:none;border:1px solid #3d5267;border-radius:16px;background:#182838;color:#f0f6fc;font-size:16px!important;line-height:20px;box-sizing:border-box;overflow-y:auto}
.chat-fullscreen .order-chat-form>button[type=submit]{grid-column:3;grid-row:2;width:64px;min-width:0;height:44px;min-height:44px!important;margin:0;padding:0;border-radius:14px;font-size:14px}
.chat-fullscreen .photo-controls{display:contents!important}
.chat-fullscreen .photo-controls .photo-attach{grid-column:1;grid-row:2;display:grid;place-items:center;width:44px;height:44px;min-height:44px;margin:0;padding:0;border:1px solid #3d5267;border-radius:14px;background:#182838;color:#edf4fa}
.chat-fullscreen .photo-controls .attachment-help{grid-column:1/-1;grid-row:3;margin:0;font-size:11px;color:#afbecd}
.chat-fullscreen .attachment-help summary{display:block;width:max-content;cursor:pointer;padding:3px 0;line-height:16px;text-decoration:underline;text-underline-offset:3px}
.chat-fullscreen .attachment-help p{margin:6px 0 0;max-height:70px;overflow:auto;font-size:12px;line-height:1.4}
.chat-fullscreen .photo-controls>.photo-preview:not([hidden]){grid-column:1/-1;grid-row:1;display:flex;align-items:center;gap:8px;margin:0;padding:0;max-height:60px;overflow:auto}
.chat-fullscreen .photo-preview img{width:44px;height:44px;object-fit:cover}.chat-fullscreen .photo-preview button{min-height:36px;width:auto;padding:6px 10px;font-size:12px}
.chat-fullscreen .photo-controls>p[role=status]{display:block;grid-column:1/-1;grid-row:4;margin:0;font-size:12px;line-height:1.4;max-height:42px;overflow:auto;overflow-wrap:anywhere;color:#b9ccdc}
.chat-fullscreen .photo-controls>p:empty{display:none}
.chat-fullscreen .order-chat-feedback{flex-shrink:0;display:block!important;margin:0!important;padding:4px 14px 8px;font-size:12px;line-height:1.4;max-height:48px;overflow:auto;background:#101d2b}.chat-fullscreen .order-chat-feedback:empty{display:none!important}
.chat-fullscreen button:focus-visible,.chat-fullscreen summary:focus-visible,.chat-open-button:focus-visible{outline:2px solid #b5ff30;outline-offset:3px}
@media(min-width:801px){.chat-fullscreen .order-chat-messages{padding-left:max(24px,calc((100vw - 960px)/2))!important;padding-right:max(24px,calc((100vw - 960px)/2))!important}.chat-fullscreen .order-chat-form{padding-left:max(24px,calc((100vw - 960px)/2))!important;padding-right:max(24px,calc((100vw - 960px)/2))!important}}

.chat-fullscreen .chat-expanded>h3,.chat-fullscreen .chat-expanded>p:not(.order-chat-feedback){display:none!important}

.chat-fullscreen .order-payment-action{flex:0 0 auto;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:4px 12px;margin:0;padding:12px 16px;border:0;border-bottom:1px solid #273747;border-radius:0;background:#101d2b}
.chat-fullscreen .order-payment-action strong{font-size:14px}.chat-fullscreen .order-payment-action p{grid-column:1;margin:0;font-size:12px;line-height:1.4;color:#afbecd}.chat-fullscreen .order-payment-action button{grid-column:2;grid-row:1/3;min-height:44px;padding:10px 12px;font-size:13px}.chat-fullscreen .order-payment-action .detail-help{display:none}



.chat-fullscreen .order-payment-action[hidden]{display:none!important}
/* Payment stays in the conversation, with its own compact scroll area. */
.chat-fullscreen .buyer-payment-choice{display:block;max-height:48dvh;overflow:auto}
.buyer-payment-choice details{width:100%}.buyer-payment-choice summary{cursor:pointer;list-style:none;padding:10px 14px;border-radius:12px;background:#b5ff30;color:#10180a;font-size:14px;font-weight:750}
.buyer-payment-choice .track-payment{display:grid;gap:12px;padding:12px 0 0;margin:0;border:0;background:none}
.buyer-payment-choice form{display:grid;gap:8px}.buyer-payment-choice label{display:grid;gap:5px;font-size:12px}.buyer-payment-choice input{min-height:44px;padding:10px;border:1px solid #3d5267;border-radius:10px;background:#182838;color:#fff;font-size:16px}
.chat-fullscreen .buyer-payment-choice button{display:block;width:100%;min-height:44px;grid-column:auto;grid-row:auto;padding:10px;font-size:13px;border-radius:10px;white-space:normal}
.buyer-payment-choice code{display:block;overflow-wrap:anywhere;font-size:13px;margin:8px 0}.buyer-payment-choice small{font-size:11px;color:#afbecd}
.chat-fullscreen .payment-quote-editor{display:grid;grid-template-columns:1fr 1fr;max-height:38dvh;overflow:auto;gap:8px}
.payment-quote-editor label{display:grid;gap:4px;font-size:12px;min-width:0}.payment-quote-editor input{min-width:0;width:100%;box-sizing:border-box;min-height:44px;border:1px solid #3d5267;border-radius:10px;padding:8px;background:#182838;color:#fff;font-size:16px}
.chat-fullscreen .payment-quote-editor>strong,.chat-fullscreen .payment-quote-editor>p{grid-column:1/-1}
.chat-fullscreen .payment-quote-editor>button{grid-column:1/-1;grid-row:auto}

/* Clearly named payment methods, sized for touch and narrow screens. */
.chat-payment-methods{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.chat-fullscreen .buyer-payment-choice .chat-payment-method{display:flex;align-items:center;gap:10px;min-width:0;min-height:64px;padding:12px;border:1px solid #3d5267;background:#182838;color:#f0f6fc;text-align:left;cursor:pointer;box-sizing:border-box}
.chat-payment-method>svg{width:24px;height:24px;flex:0 0 24px;color:#b5ff30}
.chat-payment-method>span{min-width:0}.chat-payment-method>span:last-child:not(:nth-child(2)){margin-left:auto;color:#b5ff30}
.chat-fullscreen .buyer-payment-choice .chat-payment-method strong{display:block;font-size:14px;line-height:1.3}
.chat-payment-method small{display:block;margin-top:3px;font-size:11px;line-height:1.35}
.chat-fullscreen .buyer-payment-choice .chat-payment-method:hover{border-color:#b5ff30;background:#203345}
.chat-fullscreen .buyer-payment-choice .chat-payment-method:disabled{opacity:.55;cursor:wait}
.chat-fullscreen .buyer-payment-choice .payment-method-pending{cursor:default;opacity:.7}
@media(max-width:380px){.chat-payment-methods{grid-template-columns:1fr}.chat-fullscreen .buyer-payment-choice .chat-payment-method{min-height:54px;padding:10px}}

/* Gentle chat invitation: visual scale only, never changes layout. */
.order-chat-launcher .chat-open-button:not([hidden]):not(:disabled):not([aria-expanded="true"]){animation:sbx-order-breathe 3.6s ease-in-out infinite;transform-origin:center;box-shadow:0 0 0 1px #b5ff3030,0 0 14px #b5ff3026}
@keyframes sbx-order-breathe{0%,100%{scale:1;box-shadow:0 0 0 1px #b5ff3030,0 0 12px #b5ff3020}50%{scale:1.045;box-shadow:0 0 0 2px #b5ff3045,0 0 22px #b5ff3045}}
.order-chat-launcher .chat-open-button:hover,.order-chat-launcher .chat-open-button:focus-visible,.order-chat-launcher .chat-open-button:active{animation-play-state:paused}
@media(prefers-reduced-motion:reduce){.order-chat-launcher .chat-open-button:not([hidden]):not(:disabled):not([aria-expanded="true"]){animation:none;scale:1;box-shadow:0 0 0 1px #b5ff3040,0 0 14px #b5ff3030}}


/* Buyer context stays compact above the conversation. */
.chat-fullscreen .buyer-chat-order{flex:0 1 auto;min-height:58px;max-height:30%;overflow:auto;margin:0;padding:10px 16px;border:0;border-bottom:1px solid #273747;border-radius:0;background:#101d2b}
.buyer-chat-order>summary{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 12px;cursor:pointer;list-style:none}
.buyer-chat-order>summary::-webkit-details-marker{display:none}
.buyer-chat-order [data-chat-product]{font-size:13px;font-weight:650;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.buyer-chat-order [data-chat-price]{font-size:13px;font-weight:650;color:#b5ff30}
.buyer-chat-order>summary>small{grid-column:1/-1;font-size:11px;color:#a9bdcd}
.buyer-chat-order-details{display:grid;gap:10px;padding:14px 0 2px;font-size:13px}
.buyer-chat-order-details p{margin:0;overflow-wrap:anywhere}
.buyer-chat-order-details small{color:#a9bdcd;font-size:11px;line-height:1.5}
.buyer-chat-order-details a{color:#b5ff30}
.buyer-chat-order-details button{width:fit-content;min-height:40px;padding:8px 12px;border:1px solid #3d5267;border-radius:8px;background:#182838;color:#f0f6fc;font:inherit;cursor:pointer}
.buyer-chat-order-details [data-copy-feedback]:empty{display:none}
.chat-fullscreen .buyer-chat-welcome{max-width:420px;margin:24px auto;padding:20px 8px;text-align:center;background:none;border:0}
.buyer-chat-welcome>small{font-size:11px;color:#b5ff30;letter-spacing:.06em;text-transform:uppercase}
.buyer-chat-welcome>h3{margin:10px 0;font-size:22px;line-height:1.25;color:#f0f6fc}
.buyer-chat-welcome>p{margin:10px 0;font-size:14px;line-height:1.6;color:#a9bdcd}

/* Let the visual viewport own position and size; do not animate keyboard geometry. */
dialog.chat-fullscreen{transition:none!important;animation:none!important;scroll-behavior:auto!important;overflow-anchor:none}
.chat-fullscreen .order-chat.chat-expanded{transition:none!important;animation:none!important}
.chat-fullscreen .order-chat-messages{overflow-anchor:none}
.chat-fullscreen .order-chat-messages>*{flex-shrink:0}
.chat-fullscreen .order-chat-form textarea{transition:border-color .15s ease!important;scroll-margin:0;outline:none!important;box-shadow:none!important}
.chat-fullscreen .order-chat-form textarea:focus{border-color:#a8dc58;box-shadow:0 0 0 1px #a8dc5833!important}
.chat-fullscreen .buyer-chat-order{box-sizing:border-box;min-height:0;flex-shrink:0}
.chat-fullscreen .buyer-chat-welcome{flex:none;margin:8px auto;padding:12px 8px}
.chat-fullscreen .buyer-chat-welcome>h3{font-size:20px;margin:8px 0}
.chat-fullscreen.chat-typing .order-chat.chat-expanded{padding-bottom:0!important}
.chat-typing .chat-conversation-header{padding:6px 12px;gap:10px}
.chat-typing .chat-conversation-header strong{font-size:15px}
.chat-typing .chat-back-button{background:none;border-color:transparent}
.chat-fullscreen.chat-typing .chat-conversation-header .order-chat-reference{font-size:10px}
.chat-typing .buyer-chat-order{padding:8px 12px}
.chat-typing .buyer-chat-order>summary>small,
.chat-typing .buyer-chat-order-details,
.chat-typing .order-chat-tools,
.chat-typing .buyer-payment-choice,
.chat-typing .payment-quote-editor,
.chat-typing .photo-controls .attachment-help{display:none!important}
.chat-fullscreen.chat-typing .order-chat-form{padding:8px 10px!important;gap:0 8px}
.chat-fullscreen.chat-typing .order-chat-messages{padding:10px 12px!important}
.chat-typing .buyer-chat-welcome{padding:4px 0;margin:0 auto;text-align:left}
.chat-typing .buyer-chat-welcome>small,.chat-typing .buyer-chat-welcome>h3,.chat-typing .buyer-chat-welcome>p:last-child{display:none}
.chat-typing .buyer-chat-welcome>p{font-size:13px;margin:0;line-height:1.5}

/* Game-only guidance stays above the scrolling conversation. */
.chat-game-models{flex:0 0 auto;margin:0;padding:10px 16px;border-bottom:1px solid #273747;background:#101d2b;color:#afc0cf;font-size:12px;line-height:1.45;max-height:180px;overflow:auto;overscroll-behavior:contain}
.chat-game-models>strong{display:block;margin-bottom:5px;color:#eef4fa;font-size:13px}
.chat-game-models p{margin:4px 0;font-size:inherit;line-height:inherit}
.chat-game-models p b{color:#eef4fa;margin-right:5px}
.chat-game-models .is-selected b{color:#b5ff30}
.chat-game-models summary{width:fit-content;margin-top:5px;color:#b5ff30;cursor:pointer;font-size:12px}
.chat-game-models details p{padding-top:4px}
@media(max-height:600px){.chat-game-models{max-height:105px;padding:7px 12px}}
.chat-typing .chat-game-models{padding:6px 12px;max-height:40px}
.chat-typing .chat-game-models>p,.chat-typing .chat-game-models>details{display:none}
.chat-typing .chat-game-models>strong{margin:0}
