
/* V998.3 LINE-like customer chat. No changes to existing topbar layouts. */
.cc-button-v9983{position:relative;display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;border:1px solid #d9e5f4;border-radius:12px;background:#fff;color:#234a76;cursor:pointer;font-size:20px;flex-shrink:0}
.cc-button-v9983 .cc-badge-v9983,.cc-desktop-v9983 .cc-badge-v9983{position:absolute;right:-7px;top:-6px;min-width:19px;height:19px;border-radius:16px;background:#e33d50;color:white;padding:1px 4px;font:700 11px system-ui;line-height:17px;text-align:center}
.cc-desktop-v9983{position:relative!important}.cc-desktop-v9983 .cc-badge-v9983{right:1px;top:0}
.chat-customer-v9983[hidden]{display:none!important}
.chat-customer-v9983{position:fixed;inset:0;z-index:2147481000;display:flex;align-items:center;justify-content:center;background:rgba(23,31,49,.48);font-family:system-ui,'Noto Sans Thai',sans-serif;color:#23314a}
.chat-customer-v9983 *{box-sizing:border-box}.chat-customer-v9983 .cc-shell{background:#fff;width:min(480px,100%);height:min(780px,92dvh);border-radius:17px;box-shadow:0 12px 45px #0003;display:flex;flex-direction:column;overflow:hidden}
.chat-customer-v9983 .cc-header{height:65px;min-height:65px;display:flex;align-items:center;gap:9px;padding:10px 13px;background:#fff;border-bottom:1px solid #e7ebf2}
.chat-customer-v9983 button{cursor:pointer;font:inherit}.chat-customer-v9983 .cc-back,.chat-customer-v9983 #ccCloseV9983{border:0;background:transparent;color:#526278;font-size:26px;padding:0 8px}.chat-customer-v9983 .cc-heading{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}.cc-heading b{font-size:18px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.cc-heading small{font-size:11px;color:#8491a5}.cc-body{flex:1;display:flex;flex-direction:column;min-height:0;overflow:hidden}.cc-rooms{flex:1;overflow:auto}.cc-room{width:100%;display:flex;align-items:center;gap:12px;border:0;border-bottom:1px solid #f0f2f7;background:#fff;padding:13px 15px;text-align:left;color:inherit;min-height:76px}.cc-room:hover{background:#f4f8fe}.cc-avatar{height:49px;width:49px;border-radius:50%;background:#eaf3ff;display:grid;place-items:center;font-size:22px;flex-shrink:0}.cc-detail{min-width:0;flex:1;display:flex;flex-direction:column;gap:6px}.cc-line{display:flex;align-items:center;justify-content:space-between;gap:10px;min-width:0}.cc-line b{font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.cc-line small{font-size:12px;color:#8190a3;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.cc-line time{font-size:11px;color:#98a2b3;white-space:nowrap}.cc-line em{min-width:22px;height:22px;display:grid;place-items:center;padding:1px 5px;background:#e84254;color:#fff;font:700 12px system-ui;border-radius:14px;font-style:normal;flex-shrink:0}.cc-loading,.cc-error,.cc-empty{text-align:center;padding:14px;color:#667489;font-size:13px}.cc-error{color:#b42339;background:#fff3f5}.cc-conversation{flex:1;display:flex;flex-direction:column;min-height:0}.cc-conversation[hidden],.cc-rooms[hidden],.cc-compose[hidden]{display:none!important}.cc-messages{flex:1;overflow:auto;padding:14px;background:#f4f6fa}.cc-day{margin:12px auto 18px;text-align:center;width:max-content;max-width:96%;padding:5px 13px;border-radius:50px;background:#e8edf4;color:#8693a5;font-size:11px}.cc-msg{display:flex;flex-direction:column;align-items:flex-start;margin:12px 0;max-width:83%}.cc-msg.mine{margin-left:auto;align-items:flex-end}.cc-sender{color:#8993a4;margin-bottom:3px;font-size:11px}.cc-bubble{padding:11px 13px;background:#fff;border-radius:15px 15px 15px 4px;box-shadow:0 1px 2px #0001;font-size:14px;line-height:1.6;white-space:pre-wrap;overflow-wrap:anywhere}.cc-msg.mine .cc-bubble{background:#cff1c5;border-radius:15px 15px 4px 15px}.cc-msg-meta{color:#91a0b0;margin:4px 2px;font-size:10px}.cc-compose{padding:10px 12px;display:flex;align-items:center;gap:8px;background:#fff;border-top:1px solid #e4eaf2}.cc-compose input{font:inherit;min-width:0;flex:1;border:1px solid #dfe6f0;border-radius:20px;padding:10px 13px;font-size:14px;outline:none}.cc-compose input:focus{border-color:#3c9c74}.cc-compose button{background:#21aa66;color:white;border:0;border-radius:50%;height:39px;width:39px;flex-shrink:0;font-size:18px}.cc-compose button:disabled{opacity:.45}
body.chat-open-v9983{overflow:hidden!important}
@media(max-width:650px){.chat-customer-v9983{background:#fff;align-items:stretch}.chat-customer-v9983 .cc-shell{width:100%;height:100dvh;max-height:100dvh;border-radius:0;box-shadow:none}.chat-customer-v9983 .cc-header{padding-top:env(safe-area-inset-top);height:calc(58px + env(safe-area-inset-top));min-height:calc(58px + env(safe-area-inset-top))}.chat-customer-v9983 .cc-compose{padding-bottom:max(10px,env(safe-area-inset-bottom))}}

.cc-msg.cc-pending{opacity:.65}

.chat-image-v9986{display:block;max-width:min(260px,60vw);max-height:300px;object-fit:contain;border-radius:10px;cursor:zoom-in}.chat-upload-v9986{border:0;background:#edf4ff;color:#1d6cbb;padding:8px 11px;border-radius:9px;cursor:pointer;font-size:19px}

.chat-image-wrap-v9989{display:inline-flex;flex-direction:column;gap:4px;max-width:100%}.chat-download-v9989{align-self:flex-end;font-size:11px;color:#2263a3;border:0;background:#edf4ff;border-radius:7px;padding:3px 8px;cursor:pointer}.cc-messages .chat-image-v9986{min-width:36px;min-height:24px}.chat-upload-v9986{display:inline-flex;align-items:center;justify-content:center}

#ccRoomsPanelV999{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden}#ccRoomSearchV999{flex:none;margin:10px 12px;padding:11px;border:1px solid #d7e2f0;border-radius:12px;font-size:14px}#ccRoomsPanelV999 .cc-rooms{flex:1;min-height:0;overflow-y:auto}.chat-customer-v9983 .chat-upload-v9986{min-width:44px;min-height:44px;border:1px solid #cbdcf4!important;background:#eef5ff!important;border-radius:12px!important;color:#2464ae!important}
#ccRoomsPanelV999[hidden]{display:none!important}

.cc-copy-chat-v1005{display:block;align-self:flex-end;border:0;background:transparent;color:#64748b;font-size:14px;padding:3px 6px;cursor:pointer;opacity:.85}.cc-copy-chat-v1005:active{color:#2563eb}

/* V1006: copy action anchored inside each message bubble */
.cc-bubble .cc-copy-chat-v1005{display:flex!important;align-items:center;justify-content:center;align-self:auto!important;margin:5px 0 0 auto!important;width:25px;height:24px;min-width:25px;padding:3px!important;border:0!important;border-radius:6px;background:#f1f5f9!important;color:#476584!important;opacity:1!important;line-height:1}.cc-msg.mine .cc-copy-chat-v1005{background:#b8e6b0!important}.cc-copy-chat-v1005:hover{background:#dbeafe!important;color:#155eaf!important}

/* V1007: softer customer chat. Admin theme stays unchanged. */
.chat-customer-v9983{background:rgba(23,31,49,.39)}
.chat-customer-v9983 .cc-messages{background:#fafbfd}
.chat-customer-v9983 .cc-day{background:#f0f3f8;color:#7f8b9d}
.chat-customer-v9983 .cc-bubble{background:#fff;box-shadow:0 1px 2px rgba(30,50,80,.045)}
.chat-customer-v9983 .cc-msg.mine .cc-bubble{background:#e6f8e4}
.chat-customer-v9983 .cc-msg.mine .cc-copy-chat-v1005{background:#d6efda!important}
@media(max-width:650px){.chat-customer-v9983{background:#fff}}


/* Webshop V1008: compact paperclip and attachment cards, consistent on Android/iOS. */
.chat-file-upload-v1008{display:inline-flex;align-items:center;justify-content:center;flex:none;width:44px;height:44px;border-radius:12px;border:1px solid #cbdcf4;background:#eff6ff;color:#2464ae;cursor:pointer;touch-action:manipulation}
.chat-file-upload-v1008:hover{background:#e1efff}
.chat-file-card-v1008{display:flex;align-items:center;gap:9px;max-width:min(280px,67vw);min-width:170px;white-space:normal;line-height:1.4}
.chat-file-icon-v1008{display:grid;place-items:center;width:40px;height:42px;border-radius:10px;background:#e8f0ff;font-size:23px;flex:none}
.chat-file-detail-v1008{display:flex;flex:1;flex-direction:column;gap:3px;min-width:0;overflow:hidden}
.chat-file-detail-v1008 strong{font-size:12px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;display:block;max-width:100%}
.chat-file-detail-v1008 small{font-size:10px;color:#64748b;margin:0}
.chat-file-download-v1008{display:grid;place-items:center;flex:none;width:28px;height:30px;border-radius:8px;background:#e9f3ff;color:#1865b1;text-decoration:none;font-weight:bold;font-size:21px}
.chat-file-progress-v1008{display:block;height:5px;width:100%;border-radius:99px;overflow:hidden;background:#e2e8f0}
.chat-file-progress-v1008 > span{display:block;height:100%;background:#2185e5;transition:width .15s}
.chat-file-failed-v1008{color:#b42318!important}
.cc-compose .chat-file-upload-v1008{height:39px;width:39px}
.cc-bubble:has(.chat-file-card-v1008){padding:9px!important}
@media(max-width:430px){.cc-compose{gap:5px!important;padding-left:7px!important;padding-right:7px!important}.cc-compose .chat-file-upload-v1008,.cc-compose .chat-upload-v9986{width:36px!important;min-width:36px!important;height:36px!important;min-height:36px!important;padding:4px!important}}

/* V1010 customer-only order card; base chat layouts unchanged. */
.cc-quote-v1010{min-width:min(300px,68vw);max-width:100%;white-space:normal;line-height:1.6;font-size:12px;color:#29415c}
.cc-quote-v1010>strong{display:block;font-size:15px;color:#1d3755;margin-bottom:3px}.cc-quote-v1010>small{display:block;color:#7890a7;margin-bottom:8px}
.cc-quote-v1010 hr{border:0;border-top:1px solid #e1e9f2;margin:8px 0}.cc-quote-line{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;padding:3px 0}.cc-quote-line span{min-width:0}.cc-quote-line b{white-space:nowrap}
.cc-quote-total{background:#f0faf4;border-radius:9px;padding:10px;font-weight:700;color:#087542;margin-top:6px;font-size:14px}
.cc-quote-note{color:#788aa0;font-size:11px;margin:9px 0}.cc-quote-pay-v1010{display:block;width:100%;border:0;background:#169d63;color:white;padding:12px;border-radius:11px;font-weight:700;font-size:14px;cursor:pointer}
.cc-quote-pay-v1010:disabled{opacity:.55;cursor:wait}.cc-quote-expired{display:block;text-align:center;color:#ac3d40;margin:8px 0}

/* V1011: clear, persistent final order status */
.cc-quote-final-v1011{display:block;margin:10px 0 4px;padding:10px 12px;border-radius:10px;text-align:center;font-weight:700}.cc-quote-final-v1011.cancelled{color:#a92c39;background:#fff0f1}.cc-quote-final-v1011.paid{color:#0b7544;background:#e2f9e9}.cc-quote-final-v1011.pending{color:#886010;background:#fff4dd}

/* Webshop V1020: offline support still receives messages. */
.cc-offline-v1020{display:flex;flex-direction:column;gap:3px;flex:none;background:#fff7e9;border-bottom:1px solid #ffdfa6;color:#805111;padding:9px 13px;font-size:12px;line-height:1.5}
.cc-offline-v1020[hidden]{display:none!important}.cc-offline-v1020 span{font-size:11px;color:#986b36}
/* Consistent structured notification cards in the customer system room. */
.sys-notice-card-v1020{max-width:min(420px,75vw);min-width:210px;overflow:hidden;border:1px solid #dce7f6;border-radius:12px;background:#fff;color:#28425f;white-space:normal;box-shadow:0 2px 9px #1b49640d}
.sys-notice-head-v1020{display:flex;align-items:center;gap:8px;background:#eaf4ff;color:#17518a;padding:11px 12px;font-size:13px}
.sys-notice-icon-v1020{display:grid;place-items:center;width:28px;height:28px;background:#fff;border-radius:9px;flex:none;font-size:17px}
.sys-notice-body-v1020{padding:11px 12px;white-space:pre-wrap;font-size:12px;line-height:1.7;overflow-wrap:anywhere}
.cc-bubble:has(.sys-notice-card-v1020){padding:0!important;background:transparent!important;box-shadow:none!important;border:0!important}

/* V1022: higher contrast customer-only chat and quote replies. */
.chat-customer-v9983 .cc-header{background:#f3f7ff!important;border-bottom:1px solid #cbd6e8!important}
.chat-customer-v9983 .cc-heading b{color:#142a4a!important}
.chat-customer-v9983 .cc-heading small{color:#4c5f79!important}
.chat-customer-v9983 #ccRoomsPanelV999{background:#f8faff}
.chat-customer-v9983 .cc-room{background:#fff;color:#142440;border-bottom:1px solid #d5dfea!important}
.chat-customer-v9983 .cc-room:hover{background:#eaf2ff}
.chat-customer-v9983 .cc-line small{color:#405775!important;font-size:12px}
.chat-customer-v9983 .cc-line time{color:#5a6e88!important}
.chat-customer-v9983 .cc-messages{background:#eaf0f8!important}
.chat-customer-v9983 .cc-bubble{background:#fff!important;color:#152a44!important;box-shadow:0 2px 8px #22395618!important}
.chat-customer-v9983 .cc-msg.mine .cc-bubble{background:#cfebd9!important}
.chat-customer-v9983 .cc-msg-meta,.chat-customer-v9983 .cc-sender{color:#53677f!important}
.chat-customer-v9983 .cc-day{background:#dce6f2!important;color:#334f70!important}
.chat-customer-v9983 .cc-compose{border-top:1px solid #c5d3e5!important}
.cc-history-v1022{display:block;margin:10px auto 16px;padding:8px 16px;border:1px solid #b9cce8;border-radius:20px;background:#fff;color:#2059a4;font-size:12px;font-weight:700;cursor:pointer}
.cc-reply-action-v1022{margin-left:7px;border:0;background:transparent;color:#1b64b2;font-size:11px;font-weight:700;cursor:pointer;padding:4px}
.cc-reply-preview-v1022{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 14px;border-top:1px solid #d5e0ee;border-left:3px solid #387af4;background:#f4f8ff;color:#243c5a}
.cc-reply-preview-v1022[hidden]{display:none!important}
.cc-reply-preview-v1022 span{display:flex;flex-direction:column;min-width:0;gap:3px}
.cc-reply-preview-v1022 b{font-size:12px}
.cc-reply-preview-v1022 small{color:#536b86;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cc-reply-preview-v1022 button{border:0;background:#e2eafa;border-radius:50%;height:29px;width:29px;flex:none;cursor:pointer}
.cc-referenced-v1022{border-left:3px solid #3b82f6;background:#f0f5fe;padding:6px 9px;margin-bottom:8px;border-radius:5px;display:flex;flex-direction:column;gap:2px;font-size:11px;white-space:normal}
.cc-referenced-v1022 span{color:#50627c;overflow-wrap:anywhere}

/* V1045: Customer AI quick tools; the chat remains usable on 320px phones. */
#ccAiShortcutsV1045[hidden],#ccAiShortcutsItemsV1045[hidden]{display:none!important}
.cc-ai-shortcuts-v1045{background:#f7faff;border-top:1px solid #dae7f5;padding:9px 12px 10px;flex:0 0 auto;min-width:0}
.cc-ai-shortcut-heading-v1045{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:7px;color:#1e477c;font-size:12px}
.cc-ai-shortcut-heading-v1045 button{border:0;background:transparent;color:#3978ca;font-size:11px;padding:4px 6px;cursor:pointer}
.cc-ai-shortcut-items-v1045{display:flex;gap:7px;overflow-x:auto;scrollbar-width:thin;overscroll-behavior-x:contain;padding-bottom:5px;max-width:100%}
.cc-ai-shortcut-items-v1045 button{flex:0 0 auto;font:inherit;font-size:12px;color:#24579a;background:#fff;border:1px solid #bfd6f7;border-radius:999px;padding:8px 10px;cursor:pointer;white-space:nowrap;max-width:270px}
.cc-ai-shortcut-items-v1045 button:hover{background:#eaf3ff}
.cc-ai-shortcut-items-v1045 button:disabled{opacity:.5;cursor:wait}
.cc-ai-scope-options-v1045{display:flex;gap:7px;flex-wrap:wrap;max-height:230px;overflow-y:auto;overscroll-behavior:contain}
.cc-ai-scope-options-v1045 button{flex:1 1 auto!important;max-width:100%;white-space:normal;overflow-wrap:anywhere;text-align:left}
.cc-ai-image-copy-v1045{padding:9px 11px;border:1px solid #bad6f8;color:#2468bd;background:#fff;border-radius:9px;font:inherit;font-size:12px;cursor:pointer}
.cc-ai-image-copy-v1045:disabled{opacity:.5;cursor:not-allowed}

/* V1050 quiet auto-reconnect, no error modal or cover over chat */
.chat-customer-v9983 .cc-reconnect-v1050{font:500 11px system-ui;color:#526982;background:#edf5ff;border-bottom:1px solid #dae6f6;padding:6px 12px;text-align:center;flex-shrink:0}
.chat-customer-v9983 .cc-reconnect-v1050[hidden]{display:none!important}

/* V1052 customer notifications: short in-page toast and optional sound toggle. */
.chat-customer-v9983 .cc-sound-toggle-v1052{border:1px solid #dae4f4;border-radius:10px;background:#fff;display:grid;place-items:center;width:35px;height:35px;flex:0 0 35px;font-size:17px;cursor:pointer;touch-action:manipulation;padding:0}
.chat-customer-v9983 .cc-sound-toggle-v1052:hover{background:#e8f2ff}
.cc-customer-toast-v1052{position:fixed;z-index:2147483600;top:max(16px,env(safe-area-inset-top));right:14px;max-width:min(90vw,350px);background:#fff;border:1px solid #c7daf5;border-left:4px solid #3482f6;border-radius:14px;padding:13px 15px;box-shadow:0 12px 30px #11315725;text-align:left;color:#163960;font:600 13px system-ui,-apple-system,sans-serif;cursor:pointer;overflow-wrap:anywhere}
.cc-customer-toast-v1052[hidden]{display:none!important}
@media(max-width:450px){.chat-customer-v9983 .cc-sound-toggle-v1052{width:32px;height:32px;flex-basis:32px}}
/* V1053: compact persistent coupon-expiry room, light card colors. */
.cc-expiry-card-v1053{max-width:100%;display:flex;flex-direction:column;gap:11px;white-space:normal!important;color:#163451}
.cc-expiry-head-v1053{display:flex;gap:9px;align-items:flex-start;padding:10px;background:linear-gradient(125deg,#edf6ff,#f0fdf4);border:1px solid #d6e8f6;border-radius:12px}
.cc-expiry-symbol-v1053{font-size:25px;line-height:1.1}.cc-expiry-head-v1053 b{display:block;font-size:13px;line-height:1.5}.cc-expiry-head-v1053 small{display:block;font-size:11px;color:#62819b;margin-top:3px}
.cc-expiry-groups-v1053{display:flex;flex-direction:column;gap:8px;min-width:0}.cc-expiry-group-v1053{border:1px solid #e0eaf5;background:#f9fbff;border-radius:12px;padding:10px;display:flex;flex-direction:column;gap:8px;min-width:0}
.cc-expiry-name-v1053 strong{display:block;line-height:1.5;font-size:13px;overflow-wrap:anywhere}.cc-expiry-name-v1053 em{font-style:normal;background:#dceafe;border-radius:100px;color:#2763ae;padding:2px 7px;font-size:11px;white-space:nowrap}.cc-expiry-name-v1053 small{display:block;margin-top:5px;color:#71849e;font-size:11px}
.cc-expiry-links-v1053{display:flex;flex-direction:column;gap:6px}.cc-expiry-links-v1053 a{color:#1461b2;text-decoration:none;border:1px solid #d1e3fc;background:white;border-radius:9px;padding:9px 11px;font-weight:600;font-size:12px;overflow-wrap:anywhere;min-height:38px}.cc-expiry-links-v1053 a:hover{background:#e9f4ff}
.cc-expiry-copy-v1053,.cc-expiry-copy-all-v1053{border:1px solid #bed6fb;background:#eaf4ff;color:#2264a2;border-radius:9px;padding:9px 12px;font-size:12px;font-weight:600}.cc-expiry-copy-all-v1053{background:#2980e6;color:#fff}.cc-expiry-copy-v1053:disabled,.cc-expiry-copy-all-v1053:disabled{opacity:.45}.cc-expiry-expired-v1053{color:#a85a39;font-size:11px;line-height:1.5}
.cc-msg:has(.cc-expiry-card-v1053){max-width:min(95%,560px)}.cc-bubble:has(.cc-expiry-card-v1053){width:100%;padding:10px!important}
