/* The expression tray occupies layout beneath the composer, keeping the chat visible. */
html body.mm-app[data-expression-panel] .mm-bottom-nav{display:none!important}
html body.mm-app :is(.composer,.direct-compose).connect-expression-open .cqr-trigger{display:none!important}
html body.mm-app :is(.composer,.direct-compose).connect-expression-open{max-height:none!important;overflow:visible;padding-bottom:max(0px,env(safe-area-inset-bottom))}
html body.mm-app #connect-expression-panel{box-sizing:border-box;height:clamp(160px,40dvh,360px);max-height:max(80px,calc(var(--mm-height,100dvh) - 220px));display:flex;flex-direction:column;gap:0;margin:8px -6px 0;border-top:1px solid var(--mm-line,#dfe3f0);border-radius:22px 22px 0 0;background:var(--mm-surface,#fff);color:var(--mm-text,#20263c);overflow:hidden}
html body.mm-app #connect-expression-panel [hidden],html body.mm-app #connect-expression-panel[hidden]{display:none!important}
.connect-expression-handle{width:36px;height:4px;flex:0 0 4px;background:var(--mm-muted,#778099);border-radius:8px;opacity:.45;margin:8px auto 2px}
.connect-expression-toolbar{display:flex;align-items:center;gap:8px;padding:4px 6px 8px;flex:none}
html body.mm-app .connect-expression-toolbar button{border:0;min-width:44px;min-height:44px;font:inherit;font-size:15px;color:inherit;background:transparent;cursor:pointer;border-radius:14px;touch-action:manipulation}
html body.mm-app .connect-expression-toolbar>.connect-expression-keyboard{font-size:25px}
html body.mm-app .connect-expression-toolbar>.connect-expression-close{font-size:28px}
.connect-expression-tabs{flex:1;display:flex;border:1px solid var(--mm-line,#dfe3f0);background:var(--mm-chrome,#f5f6fc);padding:3px;border-radius:16px;max-width:310px;margin:0 auto}
html body.mm-app .connect-expression-tabs button{flex:1;min-width:0;min-height:38px;padding:8px 10px;border-radius:12px;font-size:14px;font-weight:650;white-space:nowrap}
html body.mm-app .connect-expression-tabs button[aria-selected=true]{background:var(--mm-surface,#fff);color:var(--experience-accent,#6352dc);box-shadow:0 1px 5px #28385b15}
html body.mm-app #connect-expression-panel :is(button,input,select):focus-visible{outline:2px solid var(--experience-accent,#6352dc);outline-offset:-2px}
html body.mm-app #connect-expression-emojis{min-height:0;flex:1;overflow:auto;padding:0 10px 10px;overscroll-behavior:contain}
html body.mm-app #connect-expression-emojis .mm-feature-body{padding:0}
html body.mm-app #connect-expression-emojis .mm-feature-body>p{display:none}
html body.mm-app #connect-expression-emojis .mm-emoji-grid,html body.mm-app .connect-emoji-recent-grid{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:2px}
html body.mm-app #connect-expression-emojis .mm-emoji-grid button,html body.mm-app .connect-emoji-recent-grid button{display:grid;place-items:center;min-width:0;min-height:44px;padding:3px;border:0;background:transparent;color:inherit;border-radius:10px;font-size:28px;line-height:1.2;touch-action:manipulation;cursor:pointer}
html body.mm-app #connect-expression-emojis .mm-emoji-controls{display:flex;flex-wrap:wrap;gap:6px;padding-bottom:8px;position:sticky;top:0;z-index:1;background:var(--mm-surface,#fff)}
html body.mm-app #connect-expression-emojis .mm-emoji-controls :is(input,select){flex:1;min-width:110px;width:40%;font-size:16px;min-height:40px;border:1px solid var(--mm-line,#dfe3f0);border-radius:12px;padding:7px 10px;background:var(--mm-chrome,#f5f6fc);color:inherit}
html body.mm-app #connect-expression-emojis .mm-emoji-controls p{flex-basis:100%;margin:0;font-size:12px;color:var(--mm-muted,#778099)}
html body.mm-app .connect-emoji-recents>p{margin:2px 0 6px;font-size:13px;font-weight:600;color:var(--mm-muted,#778099)}
html body.mm-app #connect-expression-panel #sticker-dialog.connect-stickers-docked{box-sizing:border-box;position:static;inset:auto;margin:0;width:100%;max-width:none;height:auto;max-height:none;min-height:0;flex:1;padding:0 10px 8px;border:0;border-radius:0;box-shadow:none;background:transparent;color:inherit;overflow:auto;--st-panel:var(--mm-surface);--st-card:var(--mm-chrome);--st-field:var(--mm-surface);--st-text:var(--mm-text);--st-muted:var(--mm-muted);--st-border:var(--mm-line);--st-active:var(--experience-accent,#6352dc);--st-active-text:#fff}
html body.mm-app #connect-expression-panel #sticker-dialog[open]{display:flex;flex-direction:column}
html body.mm-app #connect-expression-panel #sticker-dialog>.sticker-heading,html body.mm-app #connect-expression-panel #sticker-dialog>.sticker-help{display:none}
html body.mm-app #connect-expression-panel .sticker-library-tabs{display:flex;flex-wrap:nowrap;gap:5px;margin:0 0 7px;padding:0 0 3px;overflow-x:auto;flex:none;scrollbar-width:none}
html body.mm-app #connect-expression-panel .sticker-library-tabs button{flex:none;min-height:36px;padding:6px 10px;border:0;border-radius:12px;font-size:13px;font-weight:550;background:transparent}
html body.mm-app #connect-expression-panel .sticker-library-tabs button[aria-pressed=true]{background:var(--mm-chrome);color:var(--experience-accent,#6352dc)}
html body.mm-app #connect-expression-panel #sticker-browse{display:flex;flex-direction:column;min-height:0;flex:1}
html body.mm-app #connect-expression-panel .sticker-search{min-height:40px;padding:7px 10px;font-size:16px;border-radius:12px;border-color:var(--mm-line);background:var(--mm-chrome);flex:none}
html body.mm-app #connect-expression-panel #sticker-pick-help{display:none}
html body.mm-app #connect-expression-panel .sticker-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;margin:7px 0;max-height:none;min-height:0;overflow:auto;flex:1;overscroll-behavior:contain;order:2}
html body.mm-app #connect-expression-panel .sticker-card{position:relative;min-width:0;padding:0 0 23px;border:0;border-radius:12px;background:transparent;gap:0}
html body.mm-app #connect-expression-panel .sticker-card img{display:block;width:100%;height:auto;aspect-ratio:1;object-fit:contain}
html body.mm-app #connect-expression-panel .sticker-card>button[data-sticker]{display:block;min-height:0;border:0;padding:0;overflow:hidden}
html body.mm-app #connect-expression-panel .sticker-card>button[data-sticker]>span{position:absolute;width:1px;height:1px;padding:0;margin:-1px;clip-path:inset(50%);overflow:hidden;white-space:nowrap}
html body.mm-app #connect-expression-panel .sticker-card .sticker-options{position:absolute;inset:auto 0 0 auto;width:44px;min-height:24px;height:24px;padding:0;border:0;letter-spacing:2px;font-size:17px;background:transparent}
html body.mm-app #connect-expression-panel .sticker-card .sticker-delete{position:absolute;inset:auto auto 0 0;width:auto;max-width:calc(100% - 35px);min-height:24px;padding:0 2px;font-size:11px}
html body.mm-app #connect-expression-panel .sticker-create-tile{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;align-self:start;aspect-ratio:1;border:0;border-radius:14px;padding:8px 4px;background:var(--mm-chrome);color:var(--mm-text);min-width:0}
html body.mm-app #connect-expression-panel .sticker-create-tile>span{display:grid;place-items:center;width:30px;height:30px;border-radius:10px;background:linear-gradient(135deg,#477ef6,#8358e8);color:#fff;font-size:25px;line-height:1}
html body.mm-app #connect-expression-panel .sticker-create-tile>strong{font-size:12px;line-height:1.25;font-weight:650}
html body.mm-app #connect-expression-panel #sticker-categories{order:3;display:flex;flex-wrap:nowrap;gap:5px;overflow-x:auto;margin:0;padding:3px 0;flex:none}
html body.mm-app #connect-expression-panel #sticker-categories:empty{display:none}
html body.mm-app #connect-expression-panel #sticker-categories button{min-height:34px;flex:none;white-space:nowrap;border:0;padding:6px 10px;font-size:12px}
html body.mm-app #connect-expression-panel .sticker-status{flex:none;min-height:0;margin:0;padding:4px 0 0;font-size:12px;line-height:1.35}
html body.mm-app #connect-expression-panel .sticker-status:empty{display:none}
html body.mm-app #connect-expression-panel #sticker-create{overflow:auto;min-height:0;flex:1}
html body.mm-app #connect-expression-panel .sticker-builder{grid-template-columns:112px minmax(0,1fr);gap:12px;margin:8px 0}
html body.mm-app #connect-expression-panel .sticker-builder canvas{width:112px;position:sticky;top:0}
html body.mm-app #connect-expression-panel .sticker-fields{display:grid;grid-template-columns:1fr;gap:9px}
html body.mm-app #connect-expression-panel .sticker-fields input,html body.mm-app #connect-expression-panel .sticker-fields select{font-size:14px;min-height:38px}
html body.mm-app #connect-expression-panel .sticker-fields label{font-size:12px}
html body.mm-app #connect-expression-panel .sticker-help{font-size:12px;margin:4px 0;line-height:1.4}
html body.mm-app #connect-expression-panel .sticker-empty{font-size:14px;padding:12px 4px}
html body.mm-app #messages>article:has(.chat-media-slot[data-media-sticker="1"]){background:transparent!important;border-color:transparent!important;box-shadow:none!important}
html body.mm-app #messages>article:has(.chat-media-slot[data-media-sticker="1"])::before,html body.mm-app #messages>article:has(.chat-media-slot[data-media-sticker="1"])::after{display:none!important}
@media(max-width:360px){html body.mm-app .connect-expression-tabs button{font-size:13px;padding:8px 5px}html body.mm-app #connect-expression-emojis .mm-emoji-grid,html body.mm-app .connect-emoji-recent-grid{grid-template-columns:repeat(7,minmax(0,1fr))}}
/* Emoji-only messages retain the original text, receipts and reaction controls. */
html body.mm-app #messages>article.connect-emoji-only{background:transparent!important;border-color:transparent!important;box-shadow:none!important;min-width:0!important}
html body.mm-app #messages>article.connect-emoji-only::before,html body.mm-app #messages>article.connect-emoji-only::after{display:none!important}
html body.mm-app #messages>article.connect-emoji-only>.mm-rich-text{font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif;font-size:64px!important;line-height:1.18!important;margin:4px 0!important;white-space:pre-wrap}
html body.mm-app #messages>article.connect-emoji-only[data-emoji-count="2"]>.mm-rich-text{font-size:52px!important}
html body.mm-app #messages>article.connect-emoji-only[data-emoji-count="3"]>.mm-rich-text{font-size:44px!important}
/* Keep usable rows in the tray when the available screen is short or wide. */
html body.mm-app #connect-expression-panel{height:clamp(280px,48dvh,420px);max-height:max(140px,calc(var(--mm-height,100dvh) - 170px))}
html body.mm-app #connect-expression-panel .connect-expression-handle{height:3px;flex-basis:3px;margin:5px auto 1px}
html body.mm-app #connect-expression-panel .connect-expression-toolbar{padding:2px 6px 6px}
html body.mm-app #connect-expression-panel .connect-expression-toolbar button{min-height:38px}
html body.mm-app #connect-expression-panel .connect-expression-tabs button{min-height:32px;padding:5px 10px}
html body.mm-app #connect-expression-panel .sticker-library-tabs{margin-bottom:4px;padding-bottom:0}
html body.mm-app #connect-expression-panel .sticker-library-tabs button{min-height:30px;padding:4px 9px;line-height:1.3}
html body.mm-app #connect-expression-panel .sticker-search{min-height:36px;height:36px;padding:6px 10px}
html body.mm-app #connect-expression-panel .sticker-grid{grid-template-columns:repeat(auto-fill,minmax(72px,1fr));margin:6px 0}
html body.mm-app #connect-expression-panel .sticker-card{padding-bottom:22px}
html body.mm-app #connect-expression-panel .sticker-card .sticker-options,html body.mm-app #connect-expression-panel .sticker-card .sticker-delete{height:22px;min-height:22px}
html body.mm-app #connect-expression-panel #sticker-categories{padding:2px 0}
html body.mm-app #connect-expression-panel #sticker-categories button{min-height:30px;padding:4px 9px;line-height:1.3}
@media(max-height:520px){html body.mm-app[data-expression-panel] #room .mm-thread-shortcuts{display:none!important}}
