/* The parent modal remains centered on desktop; only order chat receives this shell. */
#modal-root .dialog:has(>.order-chat){width:min(1100px,calc(100vw - 64px));max-width:1100px;height:min(780px,calc(100dvh - 64px));max-height:calc(100dvh - 64px);padding:0;overflow:hidden;border-radius:20px}
#modal-root .dialog:has(>.order-chat)>.dialog-close{z-index:3;top:13px;right:15px;width:44px;height:44px;background:#fff;border:1px solid #dfe5e2;border-radius:50%;color:#65736c}
.order-chat{display:grid;grid-template-columns:minmax(0,1fr) 285px;height:100%;min-height:0;color:#263c32;background:#f3f5f3;font-size:14px}
.order-chat *{box-sizing:border-box}
.order-chat button,.order-chat textarea{font:inherit}
.order-chat button{cursor:pointer;min-height:44px}
.order-chat button:focus-visible,.order-chat textarea:focus-visible,.order-chat summary:focus-visible,.order-chat-messages:focus-visible{outline:3px solid #6aa58a;outline-offset:2px}
.order-chat-main{display:flex;flex-direction:column;min-width:0;min-height:0;overflow:hidden}
.order-chat-header{display:flex;align-items:center;gap:14px;flex-shrink:0;min-height:86px;padding:17px 22px;border-bottom:1px solid #e0e6e1;background:#fbfcfb}
.order-chat-back{display:flex;align-items:center;gap:3px;flex-shrink:0;background:transparent;border:0;color:#4a6558;padding:0 6px;font-size:27px!important}
.order-chat-back span{font-size:12px}
.order-chat-heading{min-width:0;flex:1}
.order-chat-heading h2{display:flex;align-items:center;gap:10px;margin:0;font-size:18px;font-weight:650;overflow-wrap:anywhere}
.order-chat-heading h2 span{font-size:11px;white-space:nowrap;color:#78867e;font-weight:400}
.order-chat-heading p{margin:7px 0 0;color:#748078;font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.order-chat-status{flex-shrink:0;padding:6px 9px;border-radius:6px;background:#e8efe9;color:#51705c;font-size:11px}
.order-chat-mobile-context{display:none}
.order-chat-messages{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:30px 27px;scrollbar-gutter:stable;background:#f0f3f0}
.order-chat-message{display:flex;align-items:flex-start;gap:10px;margin-bottom:24px;min-width:0}
.order-chat-avatar{display:grid;place-items:center;width:35px;height:35px;flex-shrink:0;border-radius:11px;background:#dce7df;color:#587361;font-size:14px;font-weight:600}
.order-chat-message-body{min-width:0;max-width:78%}
.order-chat-message-body small{display:block;margin:0 0 7px;color:#7b877e;font-size:10px;overflow-wrap:anywhere}
.order-chat-message-body p{margin:0;padding:12px 15px;border:1px solid #e0e6df;border-radius:3px 13px 13px 13px;background:#fff;line-height:1.7;white-space:pre-wrap;overflow-wrap:anywhere}
.order-chat-message.is-own{flex-direction:row-reverse}
.order-chat-message.is-own .order-chat-avatar{background:#4b725b;color:#fff}
.order-chat-message.is-own small{text-align:right}
.order-chat-message.is-own p{background:#dcebd8;border-color:#d0e1cc;border-radius:13px 3px 13px 13px}
.order-chat-empty{display:flex;align-items:center;justify-content:center;flex-direction:column;min-height:100%;text-align:center;color:#8b978e;padding:30px 8px}
.order-chat-empty>span{font-size:40px;color:#a7b9ac;margin-bottom:14px}
.order-chat-empty strong{color:#64796b;font-size:16px}
.order-chat-empty p{font-size:12px;line-height:1.7}
.order-chat-composer{flex-shrink:0;background:#fff;border-top:1px solid #e0e6df;padding:10px 21px 14px}
.order-chat-tools{display:flex;align-items:center;gap:12px}
.order-chat-tools button{display:flex;align-items:center;gap:4px;padding:0 4px;border:0;background:none;color:#5c7765;font-size:12px;white-space:nowrap}
.order-chat-tools button span{font-size:23px;line-height:1}
.order-chat-tools small{color:#8b968e;font-size:10px;line-height:1.5}
.order-chat-input-label{display:block;margin:0}
.order-chat-input-label textarea{display:block;width:100%;min-height:72px;max-height:140px;resize:vertical;border:0;border-radius:5px;padding:8px 4px;color:#263c32;background:#fff;line-height:1.6}
.order-chat-input-label textarea::placeholder{color:#a0aaa3;font-size:12px}
.order-chat-send-row{display:flex;align-items:center;justify-content:flex-end;gap:12px;min-height:44px}
.order-chat-send-row>small{color:#98a39b;font-size:10px}
.order-chat-send-row>button{flex-shrink:0;padding:0 26px;border:0;border-radius:8px;background:#3e684f;color:#fff;font-size:12px}
.order-chat-send-row>button:disabled{opacity:.55;cursor:wait}
.order-chat-error{flex:1;margin:0;color:#a03f35;font-size:12px;overflow-wrap:anywhere}
.order-chat-readonly{flex-shrink:0;padding:20px;color:#7a847b;background:#fff;border-top:1px solid #e0e6df;text-align:center;font-size:12px;line-height:1.7}
.order-chat-sidebar{min-height:0;overflow-y:auto;overscroll-behavior:contain;border-left:1px solid #e0e6e1;padding:30px 23px 22px;background:#fbfcfb;overflow-wrap:anywhere}
.order-chat-sidebar>header{padding-right:20px}
.order-chat-sidebar>header>span{color:#8a978f;font-size:10px;letter-spacing:.15em}
.order-chat-sidebar h3{margin:9px 0 20px;font-size:15px;line-height:1.65}
.order-chat-facts{margin:0 0 23px;font-size:11px}
.order-chat-facts>div{display:grid;grid-template-columns:64px minmax(0,1fr);gap:8px;margin:13px 0}
.order-chat-facts dt{color:#8b978e}
.order-chat-facts dd{margin:0;overflow-wrap:anywhere;color:#4d6658}
.order-chat-records{border-top:1px solid #e4e9e4;padding-top:4px}
.order-chat-records h3{display:flex;align-items:center;gap:8px;margin:21px 0 12px;font-size:12px}
.order-chat-records h3 span{display:grid;place-items:center;min-width:20px;height:20px;padding:0 5px;border-radius:5px;background:#eaf0eb;color:#839487;font-size:10px}
.order-chat-records article{margin-bottom:10px;padding:11px;border:1px solid #e3e9e2;border-radius:8px;background:#fff}
.order-chat-records article strong{display:block;font-size:11px;font-weight:500}
.order-chat-records article p{margin:7px 0;line-height:1.65;color:#6c7e70;font-size:10px}
.order-chat-records article small{display:block;font-size:10px;color:#95a096;line-height:1.65;margin-top:6px}
.order-chat-muted,.order-chat-disclosure{font-size:10px;color:#8f9c92;line-height:1.8}
.order-chat-disclosure{margin-top:24px}
.order-chat-sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
@media(max-width:800px){
 #modal-root .dialog-backdrop:has(>.dialog>.order-chat){padding:0;align-items:stretch;justify-content:stretch}
 #modal-root .dialog:has(>.order-chat){position:fixed;inset:0;top:var(--order-chat-viewport-top,0px);width:100%;max-width:none;height:100vh;height:var(--order-chat-viewport-height,var(--app-visual-height,100dvh));max-height:none;border:0;border-radius:0;box-shadow:none}
 #modal-root .dialog:has(>.order-chat)>.dialog-close{display:none}
 .order-chat{display:flex;width:100%;height:100%;min-height:0}
 .order-chat-main{width:100%;height:100%}
 .order-chat-sidebar{display:none}
 .order-chat-header{min-height:76px;padding:calc(12px + env(safe-area-inset-top)) 14px 12px;gap:9px}
 .order-chat-back{width:45px;min-height:44px;padding:0;font-size:32px!important}
 .order-chat-back span{font-size:12px}
 .order-chat-heading h2{font-size:16px;gap:7px}
 .order-chat-heading h2 span{font-size:12px}
 .order-chat-heading p{max-width:100%;font-size:12px}
 .order-chat-status{font-size:12px;padding:5px 7px}
 .order-chat-mobile-context{display:block;flex-shrink:0;max-height:30%;overflow:auto;border-bottom:1px solid #e0e6e1;background:#f8faf7;font-size:13px;color:#607464}
 .order-chat-mobile-context summary{cursor:pointer;padding:12px 17px;min-height:44px}
 .order-chat-mobile-context .order-chat-facts{padding:0 18px 5px;margin-bottom:0;font-size:12px}
 .order-chat-messages{padding:23px 15px;scrollbar-gutter:auto}
 .order-chat-message{gap:8px;margin-bottom:22px}
 .order-chat-avatar{width:32px;height:32px;border-radius:9px;font-size:12px}
 .order-chat-message-body{max-width:calc(100% - 53px)}
 .order-chat-message-body p{font-size:14px;padding:10px 12px}
 .order-chat-message-body small{font-size:12px}
 .order-chat-composer{padding:5px 13px calc(9px + env(safe-area-inset-bottom));position:relative}
 .order-chat-tools{gap:9px}
 .order-chat-tools button{min-height:44px;font-size:14px}
 .order-chat-tools small{flex:1;min-width:0;font-size:12px;line-height:1.6}
 .order-chat-input-label textarea{min-height:54px;max-height:100px;resize:none;font-size:16px;background:#f5f7f3;padding:10px}
 .order-chat-input-label textarea::placeholder{font-size:14px}
 .order-chat-send-row{gap:8px;margin-top:6px;min-height:44px;flex-wrap:wrap}.order-chat-error:not(:empty){flex-basis:100%;font-size:13px}
 .order-chat-send-row>small{font-size:12px;line-height:1.5}
 .order-chat-send-row>button{min-height:44px;padding:0 23px;font-size:14px}
 .order-chat-readonly{padding:16px 18px calc(16px + env(safe-area-inset-bottom));font-size:14px}
}
@media(max-width:360px){.order-chat-heading h2 span{display:none}.order-chat-tools small{max-width:160px}.order-chat-send-row>small{display:none}.order-chat-status{max-width:64px;overflow-wrap:anywhere}}
@media(prefers-reduced-motion:reduce){.order-chat *{scroll-behavior:auto!important}}
