/* Menus stay in the visual viewport, including when the iOS keyboard is open. */
#context-layer {position:fixed;inset:0;z-index:1000;isolation:isolate;touch-action:none;}
.context-shade {position:absolute;inset:0;background:#00000024;backdrop-filter:blur(3px);-webkit-backdrop-filter:blur(3px);animation:context-shade-in .18s ease-out;}
.context-menu {position:absolute;padding:9px 0;border-radius:29px;border:1px solid #a2a2aa40;background:#f7f7f7ed;color:#17171b;box-shadow:0 12px 60px #00000032,inset 0 1px 0 #ffffff55;backdrop-filter:blur(28px) saturate(1.5);-webkit-backdrop-filter:blur(28px) saturate(1.5);overflow:auto;overscroll-behavior:contain;outline:none;}
.context-menu>button {display:flex;align-items:center;gap:17px;padding:15px 24px;width:100%;text-align:left;font-size:18px;line-height:1.3;min-height:55px;font-weight:400;}
.context-menu>button>svg {width:24px;height:24px;stroke-width:1.6;}
.context-menu button:hover,.context-menu button:focus-visible {background:#80808020;outline:none;}
.context-menu .destructive {color:#ff3b48;}
.context-divider {height:1px;background:#88888830;margin:7px 25px;}
.context-selected {filter:brightness(1.12);}
.context-open {overflow:hidden;}
[data-context-agent],.attachment-image,.attachment-image img,.message-bubble {-webkit-touch-callout:none;}
[data-context-agent],.attachment-image,.attachment-image img {-webkit-user-select:none;user-select:none;-webkit-user-drag:none;touch-action:pan-y;}
.message-bubble {touch-action:pan-y;}
.message-body {position:relative;}
.message-quote {display:flex;align-items:center;gap:9px;text-align:left;border-left:3px solid #8b6ce0;background:#8b6ce015;border-radius:5px 12px 12px 5px;max-width:100%;padding:9px 12px;margin:0 0 7px;color:var(--text);}
.message-quote>span {min-width:0;display:block;}
.message-quote strong {display:block;color:#9372ed;font-weight:600;font-size:12px;}
.message-quote span>span {display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-size:12px;overflow-wrap:anywhere;}
.message-quote img,.reply-preview img {width:36px;height:36px;border-radius:7px;object-fit:cover;flex-shrink:0;}
.reply-preview {display:flex;align-items:center;gap:10px;width:100%;padding:9px 10px 12px;margin-bottom:7px;border-bottom:1px solid var(--line);text-align:left;}
.reply-preview>svg {color:#9372ed;}
.reply-preview>div {min-width:0;flex:1;}
.reply-preview strong {color:#9372ed;font-size:12px;font-weight:600;}
.reply-preview p {color:var(--muted);font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.reply-preview button {display:grid;place-items:center;border-radius:50%;width:32px;height:32px;background:var(--bubble);flex-shrink:0;}
.message-sticker {position:absolute;right:6px;top:-15px;font-size:26px;filter:drop-shadow(0 2px 1px #00000030);pointer-events:none;}
.sticker-picker {display:grid;grid-template-columns:repeat(3,1fr);padding:8px;gap:4px;}
.sticker-picker button {font-size:30px;border-radius:15px;padding:10px;}
.sticker-picker .selected {background:#8b6ce033;}
.chat-scroll.has-chat-background {background-image:linear-gradient(var(--background-wash),var(--background-wash)),var(--chat-background);background-position:center;background-size:cover;--background-wash:#ffffffcc;}
html[data-theme=dark] .chat-scroll.has-chat-background {--background-wash:#000000b8;}
html[data-theme=dark] .context-menu {background:#252527eb;color:#f5f5f7;border-color:#5b5b644d;box-shadow:0 12px 65px #00000070,inset 0 1px 0 #ffffff0c;}
html[data-theme=dark] .context-shade {background:#00000036;}
.reply-highlight .message-bubble {animation:reply-flash 1.4s ease-out;}
@keyframes context-shade-in {from{opacity:0}to{opacity:1}}
@keyframes reply-flash {0%,30%{box-shadow:0 0 0 5px #a98aef70}100%{box-shadow:0 0 0 0 #a98aef00}}
@media(prefers-reduced-motion:reduce){.context-shade,.reply-highlight .message-bubble {animation:none;}}
