/* Mobile-first message actions; native emoji rendering and scroll remain local. */
.message-menu{display:none!important}
.message-actions:not(.has-visible-actions){display:none}
.message{margin-bottom:10px}
.message-continuation{margin-top:-6px}
.message:focus-visible{outline:2px solid var(--teal,#00839a);outline-offset:3px;border-radius:12px}
html.message-sheet-open{overflow:hidden}
dialog.message-action-sheet{box-sizing:border-box;position:fixed;inset:auto 0 0;margin:0 auto;width:min(560px,100%);max-width:100%;min-width:0;padding:0;border:1px solid var(--line,#d9dcde);border-bottom:0;border-radius:20px 20px 0 0;background:var(--theme-surface,#fff);color:var(--theme-text,#17191b);max-height:calc(var(--sheet-vh,100dvh) - max(12px,env(safe-area-inset-top,0px)));overflow:hidden;box-shadow:0 -12px 45px #0004;font:16px/1.4 -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;overscroll-behavior:contain}
dialog.message-action-sheet[open]{display:flex;flex-direction:column}
.message-action-sheet::backdrop{background:#0007}
.message-sheet-head{flex:none;touch-action:none;user-select:none;padding:0 16px 8px}
.message-sheet-handle{display:flex;align-items:center;justify-content:center;width:100%;height:28px;padding:0;border:0;background:none;color:inherit;cursor:ns-resize;touch-action:none}
.message-sheet-handle span{display:block;width:38px;height:4px;background:currentColor;opacity:.5;border-radius:4px}
.message-sheet-titleline{display:flex;align-items:center;justify-content:space-between;gap:10px}
.message-sheet-titleline h2{font-size:16px;margin:0;font-weight:600}
.message-sheet-close{font:28px/1 system-ui;width:44px;height:44px;padding:0;border:0;background:none;color:inherit;border-radius:50%}
.message-sheet-content{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y;padding:0 14px max(12px,env(safe-area-inset-bottom,0px));scrollbar-width:thin}
.message-sheet-quick{display:flex;align-items:center;justify-content:space-between;gap:2px;margin-bottom:10px;padding-bottom:10px;border-bottom:1px solid var(--line,#ddd)}
.message-sheet-quick button{display:grid;place-items:center;min-width:44px;width:44px;height:48px;padding:0;border:0;background:none;color:inherit;font:27px/1 'Apple Color Emoji','Segoe UI Emoji','Noto Color Emoji',sans-serif;border-radius:12px}
.message-sheet-quick button.reaction-add{font:28px/1 system-ui;background:var(--theme-soft,#f0f2f4);border-radius:50%;height:42px}
.message-sheet-action{display:flex;align-items:center;gap:14px;width:100%;min-height:48px;text-align:left;padding:12px 10px;background:none;color:inherit;border:0;border-radius:10px;font:inherit}
.message-sheet-action.danger{color:var(--palette-danger,#b52b43)}
.message-action-sheet button:hover{background:var(--theme-soft,#edf2f5)}
.message-action-sheet button:focus-visible,.message-emoji-search:focus-visible{outline:2px solid var(--theme-link,#015f8f);outline-offset:-2px}
.message-emoji-search{box-sizing:border-box;display:block;width:100%;position:sticky;top:0;z-index:2;margin:0 0 14px;padding:11px 12px;min-height:44px;border:1px solid var(--line,#ddd);border-radius:10px;background:var(--theme-surface,#fff);color:inherit;font:inherit;font-size:16px;line-height:1.3;scroll-margin-top:70px}
.message-emoji-section{margin:0 0 16px;scroll-margin-top:70px}
.message-emoji-section h3{font-size:14px;margin:12px 0 8px;font-weight:600}
.message-emoji-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(42px,1fr));gap:2px}
.message-emoji-choice{display:grid;place-items:center;width:100%;min-height:44px;padding:0;background:none;border:0;color:inherit;border-radius:8px;font:28px/1.2 'Apple Color Emoji','Segoe UI Emoji','Noto Color Emoji',sans-serif;overflow:hidden}
.message-sheet-categories{display:flex;flex:none;overflow-x:auto;gap:2px;padding:6px 10px max(8px,env(safe-area-inset-bottom,0px));border-top:1px solid var(--line,#ddd);background:var(--theme-surface,#fff);scrollbar-width:none}
.message-sheet-categories button{flex:1 0 36px;min-width:36px;height:44px;border:0;padding:0;border-radius:8px;background:none;color:inherit;font:20px/1 system-ui}
.message-action-sheet [hidden]{display:none!important}
@media(max-width:760px){dialog.message-action-sheet{width:100%;border-left:0;border-right:0}.message-sheet-content{padding-left:10px;padding-right:10px}}
@media(prefers-reduced-motion:no-preference){.message-action-sheet:not(.dragging){transition:height .16s ease-out}}

.message-sheet-action svg{width:21px;height:21px;flex:0 0 21px;stroke:currentColor}

.message-sheet-handle span{pointer-events:none}
.message-sheet-head{cursor:ns-resize}
.message-sheet-close{cursor:pointer}
.message-sheet-handle:focus-visible{outline:2px solid var(--theme-link,#015f8f);outline-offset:-2px;border-radius:8px}

dialog.message-action-sheet:focus-visible{outline:none}

/* Pointer actions are a compact popup; touch retains the bottom sheet. */
dialog.message-action-sheet.desktop-message-menu{inset:auto;margin:0;width:244px;min-width:0;max-width:calc(100vw - 20px);height:auto;max-height:calc(var(--sheet-vh,100dvh) - 20px);border:0;border-radius:10px;padding:5px;box-shadow:0 5px 22px #0003;font-size:13px;z-index:10020}
.message-action-sheet.desktop-message-menu::backdrop{background:transparent;backdrop-filter:none;-webkit-backdrop-filter:none}
.desktop-message-menu .message-sheet-content{padding:0;flex:0 1 auto;overflow:auto;scrollbar-width:thin}
.desktop-message-menu .message-sheet-quick{justify-content:flex-start;gap:0;margin:0 0 4px;padding:0 0 4px}
.desktop-message-menu .message-sheet-quick button{min-width:36px;width:36px;height:36px;min-height:36px;font-size:22px;border-radius:7px;cursor:pointer}
.desktop-message-menu .message-sheet-quick button.reaction-add{font-size:21px;height:32px;min-height:32px;background:none}
.desktop-message-menu .message-sheet-action{min-height:34px;padding:7px 9px;gap:9px;border-radius:6px;line-height:1.35;font-size:13px;cursor:pointer}
.desktop-message-menu .message-sheet-action svg{width:17px;height:17px;flex-basis:17px;opacity:.75}
.desktop-message-menu [hidden]{display:none!important}
@media(prefers-reduced-motion:no-preference){dialog.message-action-sheet.desktop-message-menu{transition:none}}
