.chat-badge{display:inline-flex;align-items:center;justify-content:center;min-width:21px;height:21px;padding:0 5px;background:#f0d24d;color:#24282b;border-radius:20px;font-size:11px;font-weight:700;line-height:1;margin-left:7px}
#chatButton{justify-content:space-between;min-height:40px}#chatButton span{font-size:13px}
dialog.chat-modal{position:fixed;inset:auto;left:var(--chat-left,4px);top:var(--chat-top,4px);margin:0;width:var(--chat-width,calc(100vw - 8px));height:var(--chat-height,calc(100dvh - 8px));min-width:0;min-height:0;max-width:var(--chat-width,calc(100vw - 8px));max-height:var(--chat-height,calc(100dvh - 8px));padding:0;overflow:hidden;border:0;border-radius:20px;box-shadow:0 30px 100px #10161960;box-sizing:border-box;-webkit-text-size-adjust:100%;text-size-adjust:100%}
.chat-modal #dialogBody{width:100%;height:100%;min-width:0;min-height:0;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr);overflow:hidden}
.chat-modal .modal-head{flex-shrink:0;padding:10px 22px;background:#1c2a35;border:0;color:#fff}.chat-modal .modal-head h2{font-size:16px;font-weight:600;color:#fff;letter-spacing:.1px}
.chat-modal .modal-head .close{min-height:44px;min-width:44px;color:#eef0f0;background:#ffffff0d;border:0;border-radius:50%}
.chat-modal .modal-content{display:flex;padding:0;min-width:0;min-height:0;max-width:100%;max-height:none;overflow:hidden}
.chat-room{position:relative;display:flex;flex-direction:column;flex:1;width:100%;min-width:0;min-height:0;overflow:hidden;background:#111d27;color:#e9eff3}
.chat-room svg{width:22px;height:22px;flex-shrink:0;display:block}
.chat-caption{display:flex;align-items:center;gap:12px;padding:0 22px 16px;background:#1c2a35;flex-shrink:0;color:#fff}
.chat-brand,.chat-empty-mark{display:grid;place-items:center;flex-shrink:0;width:43px;height:43px;background:#edce47;color:#252a2d;border-radius:14px;font-size:19px;font-weight:900;letter-spacing:-1px;transform:rotate(-4deg)}
.chat-caption b{font-size:16px;display:block;letter-spacing:.15px}.chat-caption div>span{display:block;font-size:11px;color:#b5bdbd;margin-top:3px}.chat-private{margin-left:auto;font-size:10px;color:#9ca9aa;border:1px solid #ffffff24;border-radius:20px;padding:6px 9px}
.chat-push-settings{display:grid;place-items:center;flex-shrink:0;min-width:44px;min-height:44px;padding:8px;border:1px solid #ffffff24;border-radius:50%;background:#ffffff0d;color:#edce47;margin-left:auto}.chat-caption>div{min-width:0}.chat-push-settings:hover{background:#ffffff20}
.chat-messages{flex:1;min-height:60px;overflow-y:auto;overscroll-behavior:contain;padding:12px 24px 20px;scrollbar-gutter:stable;background-color:#111d27;background-image:url("/chat-injectors.svg?v=0.9.1");background-size:420px 420px;background-repeat:repeat;overflow-anchor:none}
.chat-day{width:fit-content;max-width:100%;margin:9px auto 20px;padding:5px 12px;border-radius:20px;background:#263745;color:#c2ced6;font-size:11px;line-height:1.4}
.chat-message{display:flex;align-items:flex-end;gap:8px;width:100%;margin:0 0 12px;overflow-wrap:anywhere}
.chat-avatar{display:grid;place-items:center;flex-shrink:0;width:30px;height:30px;background:#456053;color:#fff;border-radius:11px;font-size:10px;font-weight:700;margin-bottom:2px}
.chat-bubble{position:relative;max-width:80%;min-width:125px;border:1px solid #314351;background:#243442;border-radius:16px 16px 16px 4px;padding:10px 13px 6px;box-shadow:0 2px 5px #00000018;overflow:hidden}
.chat-message header{display:flex;gap:7px;align-items:baseline;flex-wrap:wrap;font-size:10px;color:#abbcc8;line-height:1.5;margin-bottom:5px}
.chat-message strong{font-size:12px;color:#c3decf}.chat-message p{color:#edf2f5;font-size:14px;line-height:1.5;white-space:pre-wrap;margin:0}.chat-message footer{display:flex;justify-content:flex-end;margin-top:4px}.chat-message time{font-size:10px;color:#a8bbc9}
.chat-mine{justify-content:flex-end}.chat-mine .chat-avatar{display:none}.chat-mine .chat-bubble{background:#34473e;border-color:#425c4d;border-radius:16px 16px 4px 16px}.chat-mine strong{color:#f0d77a}.chat-mine header span{color:#b6cbbd}.chat-mine time{color:#b6cbbd}
.chat-empty{display:flex;flex-direction:column;align-items:center;padding:40px 10px;color:#b9c9d5;text-align:center;line-height:1.6;font-size:14px}.chat-empty-mark{width:65px;height:65px;font-size:26px;margin:0 0 20px;box-shadow:0 8px 15px #5b5f4520}.chat-empty b{font-size:20px;color:#f2f5f7}.chat-empty p{margin-top:8px}
.chat-older{display:block;margin:0 auto 16px;padding:8px 14px;min-height:40px;border:1px solid #435565;border-radius:20px;background:#243543;font-size:11px;color:#d4dfe6}
.chat-composer{position:relative;flex-shrink:0;padding:12px 18px max(12px,env(safe-area-inset-bottom));border-top:1px solid #31424e;background:#1c2a35}
.chat-input-row{display:flex;align-items:flex-end;gap:8px}.chat-input-row textarea{flex:1;min-width:0;min-height:46px;max-height:100px;height:46px;resize:none;font-size:16px;line-height:22px;border:1px solid #435666;border-radius:22px;padding:11px 16px;background:#253642;color:#edf2f5;margin:0;overflow-y:auto;box-shadow:none}.chat-input-row textarea:focus{outline:2px solid #d2b84c;outline-offset:1px}.chat-input-row textarea:read-only{background:#202f39}
.chat-input-row button{display:flex;align-items:center;justify-content:center;min-width:46px;min-height:46px;border:0;border-radius:50%;padding:10px;flex-shrink:0}.chat-input-row .chat-attach{background:transparent;color:#b8c9d5}.chat-input-row #chatSend{background:#edce47;color:#2b302a;box-shadow:0 2px 4px #b59b371f}.chat-input-row #chatSend:disabled{opacity:.45;box-shadow:none}.chat-input-row #chatSend span{font-size:11px}.chat-input-row #chatSend:has(span){border-radius:23px}
#chatCounter{display:block;text-align:right;color:#b4c4cf;font-size:10px;margin-top:3px}#chatCounter:empty{display:none}.chat-status{font-size:12px;line-height:1.4;color:#f0d77a;margin:8px 4px 0!important;max-height:54px;overflow-y:auto}.chat-status:empty{display:none}
.chat-new{flex-shrink:0;background:#2b4037;color:#d5e7da;padding:9px;font-size:12px;min-height:40px;border:0;border-top:1px solid #4b6554}
.chat-attach-menu{position:absolute;z-index:3;overflow-y:auto;overscroll-behavior:contain;bottom:calc(100% - 3px);left:18px;width:255px;max-width:calc(100% - 36px);padding:8px;border-radius:16px;background:#243543;box-shadow:0 6px 35px #00000055;border:1px solid #435666}.chat-attach-menu button{display:flex;align-items:center;gap:12px;width:100%;min-height:46px;border:0;background:transparent;padding:10px;font-size:14px;border-radius:10px;color:#e1e9ef}.chat-attach-menu button:hover{background:#334b5b}.chat-attach-menu small{display:block;border-top:1px solid #435666;margin:4px 7px;padding:9px 0 3px;font-size:10px;line-height:1.6;color:#b6c7d3}
.chat-queue{display:flex;gap:8px;overflow-x:auto;max-height:110px}.chat-queue:not(:empty){padding:0 0 12px}.chat-queued{display:flex;align-items:center;gap:8px;flex-shrink:0;max-width:100%;width:285px;min-height:58px;background:#263a47;border:1px solid #435d6c;border-radius:12px;padding:6px}.chat-queued>img,.chat-queued-icon{width:42px;height:42px;flex-shrink:0;border-radius:7px;object-fit:cover;background:#344e5e;display:grid;place-items:center;color:#d4e3ed}.chat-queued>span:not(.chat-queued-icon){min-width:0;flex:1}.chat-queued b{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:11px;color:#e1eaf0}.chat-queued small{display:block;font-size:10px;line-height:1.3;color:#b8c9d5;max-height:40px;overflow:auto}.chat-queued button{min-width:34px;min-height:44px;display:grid;place-items:center;padding:4px;background:transparent;color:#c5d7e2;border:0;border-radius:8px}.chat-queued button svg{width:18px;height:18px}.chat-queued.has-error{border-color:#d9a98d}.chat-queued.has-error small{color:#ffc8a7}
.chat-attachments{display:flex;flex-direction:column;gap:7px;margin:6px -6px 8px}.chat-photo{position:relative;max-width:330px;border-radius:10px;overflow:hidden;background:#dce2dc}.chat-photo>button[data-chat-photo]{display:block;width:100%;border:0;background:transparent;padding:0;cursor:zoom-in}.chat-photo img{display:block;width:100%;height:auto;max-height:300px;min-height:80px;object-fit:cover;aspect-ratio:4/3}.chat-media-download{position:absolute;right:7px;bottom:7px;width:38px;height:38px;border-radius:50%;background:#16291fc9;color:#fff;display:grid;place-items:center}.chat-video{max-width:330px;min-width:200px;overflow:hidden;border-radius:10px;background:#212927}.chat-video video{display:block;width:100%;max-height:290px;aspect-ratio:4/3;background:#1e2523;object-fit:contain}.chat-video-caption{display:flex;align-items:center;gap:8px;padding:9px 10px;color:#e0e7e0!important;text-decoration:none;font-size:11px;overflow-wrap:anywhere}.chat-video-caption span{min-width:0}.chat-video-caption small{display:block;font-size:10px;color:#a3b4a8;margin-top:3px}
.chat-file{display:flex;align-items:center;gap:10px;min-height:68px;padding:9px 10px;border-radius:10px;background:#2e4353;border:1px solid #465f70;color:#e1eaf0;text-decoration:none;max-width:340px;min-width:200px}.chat-file>span:nth-child(2){min-width:0;flex:1}.chat-file b{display:block;font-size:12px;line-height:1.4}.chat-file small{display:block;font-size:10px;color:#b6cbd8;margin-top:4px}.chat-file-icon{width:35px;min-width:35px;height:40px;border-radius:8px;background:#405b6c;display:grid;place-items:center}.chat-file>svg{width:18px}.chat-mine .chat-file{background:#2d4035;border-color:#56715d}
.chat-lightbox{position:absolute;inset:0;z-index:5;display:flex;flex-direction:column;background:#17201ff5;color:#fff}.chat-lightbox header{display:flex;gap:8px;align-items:center;padding:8px 10px}.chat-lightbox header>span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px}.chat-lightbox header button,.chat-lightbox header a{display:grid;place-items:center;min-width:44px;min-height:44px;border:0;background:#ffffff14;color:#fff;border-radius:50%}.chat-lightbox>img{flex:1;width:100%;min-height:0;object-fit:contain;padding:8px}
@media(max-width:600px){dialog.chat-modal{border-radius:16px}.chat-modal .modal-head{padding:4px 12px}.chat-caption{padding:0 14px 12px;gap:10px}.chat-private{display:none}.chat-caption b{font-size:15px}.chat-brand{width:36px;height:36px;font-size:17px;border-radius:11px}.chat-messages{padding:10px 10px 16px;scrollbar-gutter:auto}.chat-message{gap:5px}.chat-avatar{width:24px;height:24px;font-size:9px;border-radius:9px}.chat-bubble{max-width:88%;padding:8px 10px 5px}.chat-mine .chat-bubble{max-width:91%}.chat-composer{padding:8px 8px max(8px,env(safe-area-inset-bottom))}.chat-input-row{gap:4px}.chat-attach-menu{left:8px}.chat-input-row textarea{padding-left:12px;padding-right:12px}.chat-file,.chat-video{min-width:160px}.chat-photo img{max-height:250px}.chat-video video{max-height:240px}}
@media(max-height:480px){.chat-caption{display:none}.chat-modal .modal-head{padding-top:0;padding-bottom:0}.chat-composer{padding:5px 7px}.chat-input-row textarea{max-height:62px}.chat-queue{max-height:75px}.chat-queue:not(:empty){padding-bottom:5px}.chat-status{max-height:32px;font-size:11px;margin-top:3px!important}.chat-messages{padding-top:5px}}

.chat-input-row textarea::placeholder{color:#a9bcc9;opacity:1}
.chat-messages{scrollbar-color:#566e7c #111d27;color-scheme:dark}

.chat-photo>button.chat-media-download{border:0;padding:0;cursor:pointer}
.chat-message footer{align-items:center;gap:10px;flex-wrap:wrap}.chat-time{display:flex;align-items:center;gap:5px;flex-wrap:wrap;margin-left:auto}.chat-edited{font-size:10px;color:#b6cbbd}
.chat-edit-button{padding:4px 0;min-height:44px;border:0;background:transparent;color:#d7e7db;font-size:11px;text-decoration:underline;text-underline-offset:3px}.chat-edit-button:disabled{opacity:.4}
.chat-edit-bar{display:flex;align-items:center;gap:10px;padding:0 2px 8px;color:#f0d77a}.chat-edit-bar>div{flex:1;min-width:0}.chat-edit-bar strong{display:block;font-size:12px;font-weight:500;line-height:1.4}.chat-edit-bar button{min-height:44px;border:0;background:transparent;color:#d7e5ef;padding:6px;font-size:12px}.chat-edit-bar #chatEditCancel{flex-shrink:0}.chat-edit-bar #chatEditReload{text-align:left;text-decoration:underline;padding-left:0}
.chat-room button:focus-visible{outline:2px solid #edce47;outline-offset:2px}
.chat-delete-button{padding:4px 0;min-height:44px;border:0;background:transparent;color:#efb8ac;font-size:11px;text-decoration:underline;text-underline-offset:3px}.chat-delete-button:disabled{opacity:.4}
.chat-message p.chat-deleted{font-style:italic;font-size:12px;color:#b2bfc4}.chat-messages{scroll-behavior:auto}
#chatTimeline{display:flow-root;min-width:0}
.chat-delete-question{flex-basis:100%;font-size:12px;color:#edc2b9}
/* Message actions are hidden until long press / right click / keyboard. */
.chat-message{position:relative;touch-action:pan-y;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}.chat-message img{-webkit-touch-callout:none;user-select:none;-webkit-user-drag:none}.chat-message .chat-bubble{transition:transform .13s ease-out}.chat-message[data-swipe] .chat-bubble{transition:none}.chat-message[data-swipe]::before{position:absolute;top:calc(50% - 16px);width:32px;height:32px;display:grid;place-items:center;border-radius:50%;color:#edce47;background:#2a3e48;z-index:0}.chat-message[data-swipe="right"]::before{content:'♡';left:0;font-size:25px}.chat-message[data-swipe="left"]::before{content:'↩';right:0;font-size:24px}.chat-message:focus-visible .chat-bubble{outline:2px solid #edce47;outline-offset:-2px}
.chat-reactions{display:flex;flex-wrap:wrap;gap:5px;margin-top:6px}.chat-reactions:empty,.chat-reply:empty{display:none}.chat-reaction{display:flex;align-items:center;gap:5px;min-width:44px;min-height:36px;padding:4px 9px;font-size:18px;line-height:1;background:#17263180;color:#d5e3ea;border:1px solid #536c7750;border-radius:16px}.chat-reaction span{font-size:12px}.chat-reaction.is-mine{border-color:#d3bd55;background:#6b643950}.chat-reaction:disabled{opacity:.6}
.chat-quote,.chat-quote-preview{display:block;text-align:left;min-width:0;padding:7px 10px;border:0;border-left:3px solid #dbc44c;border-radius:5px;background:#12222a60;color:#dce7e9;line-height:1.4;width:100%}.chat-quote{margin:5px 0 8px;min-height:44px}.chat-quote strong,.chat-quote-preview strong,.chat-action-preview strong,.chat-original strong{display:block;font-size:12px;color:#efd77a}.chat-quote span,.chat-quote-preview span,.chat-action-preview span{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere;font-size:12px;color:#d4dfe4;margin-top:3px}.chat-reply-bar{display:flex;align-items:center;gap:6px;padding:0 0 8px}.chat-reply-bar button{min-width:44px;min-height:44px;background:transparent;color:#dce6ec;border:0;font-size:26px}.chat-reply-bar .chat-quote-preview{flex:1}.chat-original{white-space:pre-wrap;overflow-wrap:anywhere;font-size:14px;max-height:45dvh;overflow:auto;line-height:1.5;padding:10px}
.chat-actions-layer{position:absolute;z-index:8;inset:0;display:flex;align-items:flex-end;justify-content:center;padding:14px;isolation:isolate}.chat-action-shade{position:absolute;inset:0;width:100%;height:100%;border:0;border-radius:0;background:#040c1380;backdrop-filter:blur(2px);z-index:-1}.chat-action-sheet{width:360px;max-width:100%;max-height:100%;overflow-y:auto;background:#22323e;border:1px solid #516674;border-radius:18px;box-shadow:0 8px 40px #0007;padding:10px;color:#edf2f5}.chat-action-sheet h3{margin:9px 8px;font-size:17px;color:#edf2f5}.chat-action-sheet p{margin:10px 8px;color:#bdcdd7;font-size:13px;line-height:1.5}.chat-action-sheet>button{display:block;width:100%;min-height:46px;padding:12px 14px;text-align:left;border:0;border-radius:10px;background:transparent;color:#e4edf2;font-size:14px}.chat-action-sheet>button:hover{background:#344954}.chat-action-sheet>button.chat-action-danger{color:#ffc1b5}.chat-action-sheet button:disabled{opacity:.5}.chat-reaction-picker{display:grid;grid-template-columns:repeat(4,1fr);gap:4px;border-bottom:1px solid #ffffff19;padding-bottom:8px;margin-bottom:5px}.chat-reaction-picker button{min-height:44px;border:1px solid transparent;border-radius:12px;background:transparent;font-size:26px;padding:5px}.chat-reaction-picker button:hover,.chat-reaction-picker button[aria-pressed="true"]{background:#5d61414d;border-color:#c1ac5c}.chat-action-preview{padding:6px 9px 12px}.chat-highlight .chat-bubble{box-shadow:0 0 0 2px #edce47}
@media(prefers-reduced-motion:reduce){.chat-message .chat-bubble{transition:none}}

/* Bound every flex/grid level; long text, media or a saved reply cannot size the window. */
html.chat-is-open,body.chat-is-open{overflow:hidden;overscroll-behavior:none}
.chat-modal .modal-head{min-width:0}.chat-modal .modal-head h2{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-modal .modal-head .close{flex:none}
.chat-messages{width:100%;min-width:0;min-height:0;overflow-x:hidden;overflow-y:auto}
.chat-message,.chat-caption,.chat-input-row,.chat-composer,.chat-reply-bar,.chat-edit-bar,.chat-attachments{min-width:0;max-width:100%}
.chat-bubble{min-width:0;flex:0 1 auto}.chat-bubble header,.chat-bubble strong,.chat-quote,.chat-quote-preview,.chat-action-preview,.chat-original{min-width:0;max-width:100%;overflow-wrap:anywhere}
.chat-file,.chat-video,.chat-photo{min-width:0;max-width:100%}.chat-file{width:340px}.chat-video{width:330px}.chat-attachments img,.chat-attachments video{max-width:100%}
.chat-composer{max-height:55%;overflow-y:auto;overscroll-behavior:contain}.chat-input-row{width:100%}.chat-reactions{max-width:100%}.chat-action-sheet{min-width:0;overscroll-behavior:contain}.chat-actions-layer{min-width:0;min-height:0;max-width:100%;max-height:100%}
.chat-compact .chat-caption{display:none}.chat-compact .modal-head{padding-top:0;padding-bottom:0}.chat-compact .chat-composer{padding:5px 7px;max-height:60%}.chat-compact .chat-input-row textarea{max-height:62px}.chat-compact .chat-queue{max-height:60px}.chat-compact .chat-queue:not(:empty){padding-bottom:5px}.chat-compact .chat-status{max-height:28px;font-size:11px;margin-top:3px!important}.chat-compact .chat-messages{padding-top:5px}.chat-compact .chat-quote-preview span{-webkit-line-clamp:1}

/* URLs wrap inside the bubble, including long catalogue and marketplace links. */
.chat-text-link{color:#9ed7ff;text-decoration:underline;text-underline-offset:3px;overflow-wrap:anywhere;word-break:break-word;cursor:pointer}
.chat-mine .chat-text-link{color:#b9e5ff}.chat-text-link:hover{color:#e0f3ff}.chat-text-link:focus-visible{outline:2px solid #edce47;outline-offset:2px;border-radius:2px}

/* Recipient stays visible above the history, independently of the composer. */
.chat-recipient-bar{display:flex;flex:none;align-items:center;gap:10px;min-width:0;padding:9px 16px;background:#1c2a35;border-top:1px solid #30414b;border-bottom:1px solid #30414b;color:#d6e0e8}
.chat-recipient-bar label{font-size:12px;font-weight:600;flex:none}.chat-recipient-bar select{flex:1;width:0;min-width:0;max-width:390px;min-height:40px;background:#253845;color:#f2f6f8;border:1px solid #516572;border-radius:10px;font-size:14px;padding:8px 30px 8px 10px;text-overflow:ellipsis}
.chat-recipient-bar small{font-size:11px;color:#f1d66e;white-space:nowrap}.chat-recipient-bar small:empty{display:none}
@media(max-width:600px){.chat-recipient-bar{padding:7px 10px;gap:8px;flex-wrap:wrap}.chat-recipient-bar select{font-size:16px}.chat-recipient-bar small{flex-basis:100%;padding-left:31px}}
.chat-compact .chat-recipient-bar{padding-top:3px;padding-bottom:3px}.chat-compact .chat-recipient-bar select{min-height:32px;padding-top:3px;padding-bottom:3px}.chat-compact #chatOtherUnread{display:none}
