/* Compact, uncluttered sidebar and contextual chat actions */
/* Sidebar sizing is owned by sidebar-interactions.css and the resize grip. */
#yap-tool-menu .yap-chat-entry{position:relative;overflow:visible}
#yap-tool-menu .yap-chat-entry .yap-chat-actions{position:relative;flex:none;display:flex;align-items:center;z-index:2}
#yap-tool-menu .yap-chat-entry .yap-chat-actions summary{list-style:none;display:grid;place-items:center;cursor:pointer;width:30px;height:30px;color:var(--fg);font-size:20px;opacity:0;border-radius:7px}
#yap-tool-menu .yap-chat-entry .yap-chat-actions summary::-webkit-details-marker{display:none}
#yap-tool-menu .yap-chat-entry:hover .yap-chat-actions summary,#yap-tool-menu .yap-chat-entry:focus-within .yap-chat-actions summary,#yap-tool-menu .yap-chat-entry .yap-chat-actions[open] summary{opacity:1}
#yap-tool-menu .yap-chat-entry .yap-chat-actions summary:hover{background:color-mix(in srgb,var(--fg) 12%,transparent)}
#yap-tool-menu .yap-chat-options{position:absolute;z-index:80;top:31px;right:0;width:172px;padding:6px;display:grid;gap:2px;border:1px solid var(--border);border-radius:12px;background:var(--side,#182235);box-shadow:0 12px 28px #0006}
#yap-tool-menu .yap-chat-options button{display:block!important;min-height:37px!important;width:100%!important;padding:8px 10px!important;font-size:13px!important;text-align:left;color:var(--fg)!important;border-radius:7px;background:transparent!important}
#yap-tool-menu .yap-chat-options button:hover{background:color-mix(in srgb,var(--fg) 10%,transparent)!important}
#yap-tool-menu .yap-chat-options button:last-child{color:#f28d8d!important}
#yap-tool-menu #history{overflow-x:hidden!important;scrollbar-width:thin}
#yap-tool-menu .yap-nav-recents{overflow:hidden!important;min-width:0!important}
#yap-tool-menu #history .yap-chat-entry>button:first-child{font-weight:450!important;font-size:14px!important}
#yap-tool-menu #yap-nav-primary .yap-nav-item,#yap-tool-menu #yap-vault-open{font-weight:550!important}
@media(hover:none){#yap-tool-menu .yap-chat-entry .yap-chat-actions summary{opacity:1}}
#yap-tool-menu .yap-sidebar-footer{margin-top:auto!important;min-width:0;display:flex;flex-direction:column;gap:5px;border-top:1px solid var(--border);padding-top:8px}
#yap-tool-menu .yap-sidebar-footer .yap-bottom-settings{order:2;margin:0!important;border:0!important;padding:0!important}
#yap-tool-menu .yap-sidebar-footer .yap-bottom-settings>summary{min-height:42px;border-radius:11px;padding:10px 12px;font-size:13px}
#yap-tool-menu .yap-sidebar-footer>*{min-width:0;max-width:100%}
#yap-tool-menu #history .yap-chat-entry{min-width:0;max-width:100%;overflow:visible}
#yap-tool-menu #history .yap-chat-entry>button:first-child{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#yap-tool-menu .yap-chat-options{right:4px;max-width:calc(100vw - 40px)}

/* Context menus occupy the browser top layer: never clip against the scroll area
   or slip under the sticky account/profile footer. Placement is set from JS. */
#yap-tool-menu .yap-chat-options[popover]:not(:popover-open){display:none!important}
#yap-tool-menu .yap-chat-options[popover]:popover-open{
 position:fixed!important;inset:auto;right:auto!important;margin:0!important;
 max-height:calc(100dvh - 16px);overflow-y:auto;overscroll-behavior:contain;
}
body>.yap-chat-options.yap-chat-options-fallback{
 position:fixed!important;display:grid!important;gap:2px;
 width:172px;max-height:calc(100dvh - 16px);overflow-y:auto;
 margin:0;padding:6px;box-sizing:border-box;z-index:2147483000;
 border:1px solid var(--border);border-radius:12px;
 background:var(--side,#182235);color:var(--fg);box-shadow:0 12px 28px #0006;
}
body>.yap-chat-options.yap-chat-options-fallback button{
 display:block;width:100%;min-height:37px;padding:8px 10px;
 font-size:13px;text-align:left;color:inherit;border:0;border-radius:7px;background:transparent;
}
body>.yap-chat-options.yap-chat-options-fallback button:last-child{color:#c83333}
body>.yap-chat-options.yap-chat-options-fallback button:hover{background:color-mix(in srgb,var(--fg) 10%,transparent)}
