#x-context-menu,
#x-examine {
    --menu-background: #fff;
    --menu-text: #202124;
    --menu-muted: #80868b;
    --menu-border: #dadce0;
    --menu-hover: #e8eaed;

    position: fixed;
    z-index: 1000;
    background: var(--menu-background);
    color: var(--menu-text);
    border: 1px solid var(--menu-border);
    border-radius: 8px;
    box-shadow: 0 4px 16px #0003;
    font: 14px system-ui, 'Segoe UI', sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme=light]) #x-context-menu,
    :root:not([data-theme=light]) #x-examine {
        --menu-background: #292a2d;
        --menu-text: #e8eaed;
        --menu-muted: #9aa0a6;
        --menu-border: #3c4043;
        --menu-hover: #3c4043;
    }
}

:root[data-theme=dark] #x-context-menu,
:root[data-theme=dark] #x-examine {
    --menu-background: #292a2d;
    --menu-text: #e8eaed;
    --menu-muted: #9aa0a6;
    --menu-border: #3c4043;
    --menu-hover: #3c4043;
}

#x-context-menu[hidden],
#x-examine[hidden] {
    display: none;
}

#x-context-menu {
    z-index: 1001;
    min-width: 220px;
    padding: 4px 0;
}

#x-context-menu [role=menuitem] {
    display: block;
    width: 100%;
    padding: 6px 24px;
    border: none;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: default;
}

#x-context-menu [role=menuitem]:hover,
#x-context-menu [role=menuitem]:focus {
    background: var(--menu-hover);
    outline: none;
}

#x-context-menu [role=menuitem]:disabled {
    color: var(--menu-muted);
    background: none;
}

#x-context-menu [role=separator] {
    height: 1px;
    margin: 4px 0;
    background: var(--menu-border);
}

#x-context-menu .hint {
    padding: 6px 24px 2px;
    color: var(--menu-muted);
    font-size: 12px;
}

#x-examine {
    max-width: min(360px, calc(100vw - 32px));
    padding: 8px 12px;
}
